From b168f05b77133e9545a2d00a6103b642476c04af Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Wed, 17 Dec 2025 12:37:57 +0000 Subject: [PATCH 01/32] wip --- resources/js/stories/Button.stories.ts | 90 ++++++++++++++++++++---- resources/js/stories/Calendar.stories.ts | 82 +++++++++------------ resources/js/stories/Card.stories.ts | 10 ++- resources/js/stories/docs/Button.mdx | 4 ++ resources/js/stories/docs/Calendar.mdx | 6 -- resources/js/stories/icons.ts | 12 ++++ 6 files changed, 135 insertions(+), 69 deletions(-) create mode 100644 resources/js/stories/icons.ts diff --git a/resources/js/stories/Button.stories.ts b/resources/js/stories/Button.stories.ts index 44c0985238f..50fc5dd4cc5 100644 --- a/resources/js/stories/Button.stories.ts +++ b/resources/js/stories/Button.stories.ts @@ -1,26 +1,62 @@ -import type { Meta, StoryObj } from '@storybook/vue3'; -import { Button } from '@ui'; -import { computed } from 'vue'; +import type {Meta, StoryObj} from '@storybook/vue3'; +import {Button, ButtonGroup} from '@ui'; +import {computed} from 'vue'; +import {icons} from './icons'; const meta = { title: 'Components/Button', component: Button, argTypes: { - variant: { + as: { + control: 'text', + description: 'The element or component this component should render as.', + }, + href: { control: 'text' }, + target: { + control: 'text', + description: "When `href` is provided, this prop controls the link's `target` attribute.", + }, + icon: { control: 'select', - options: ['default', 'primary', 'danger', 'filled', 'ghost', 'ghost-pressed', 'subtle', 'pressed'], + options: icons, + description: 'Icon name. [Browse available icons](/?path=/story/components-icon--all-icons)', + }, + iconAppend: { + control: 'select', + options: icons, + description: 'Icon name. Will display after the label. [Browse available icons](/?path=/story/components-icon--all-icons)', + }, + iconOnly: { + control: 'boolean', + description: "When `true`, the button's padding will be adjusted to account for no text", + }, + inset: { + control: 'boolean', + description: 'When using `ghost` or `subtle` button variants, you can use the `inset` prop to remove any invisible padding for better alignment.', + }, + loading: { + control: 'boolean', + description: 'When `true`, the button shows an animated loading icon.' + }, + round: { + control: 'boolean', + description: 'When `true`, the button will be rounded.' }, size: { control: 'select', - options: ['lg', 'base', 'sm', 'xs'], + description: 'Controls the size of the button.

Options: `2xs`, `xs`, `sm`, `base`, `lg`', + options: ['2xs', 'xs', 'sm', 'base', 'lg'], }, text: { control: 'text' }, - icon: { control: 'text' }, - iconAppend: { control: 'text' }, - loading: { control: 'boolean' }, - disabled: { control: 'boolean' }, - round: { control: 'boolean' }, - iconOnly: { control: 'boolean' }, + type: { + control: 'select', + description: "Unless `href` is provided, this component defaults to a `