@polymarbot/nuxt-layer-shadcn-ui 0.1.9 → 0.2.0-w

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/app/assets/styles/colors.css +10 -10
  2. package/app/assets/styles/globals.css +1 -0
  3. package/app/assets/styles/z-index.css +27 -0
  4. package/app/components/ui/Accordion/index.stories.ts +60 -56
  5. package/app/components/ui/Accordion/index.vue +1 -1
  6. package/app/components/ui/AdminLayout/SidebarMenus.vue +0 -2
  7. package/app/components/ui/AdminLayout/index.stories.ts +9 -8
  8. package/app/components/ui/Alert/index.stories.ts +28 -26
  9. package/app/components/ui/Alert/index.vue +6 -6
  10. package/app/components/ui/Alert/types.ts +2 -1
  11. package/app/components/ui/AlertDialog/index.stories.ts +85 -50
  12. package/app/components/ui/AsyncDataTable/index.stories.ts +53 -36
  13. package/app/components/ui/Avatar/index.stories.ts +56 -51
  14. package/app/components/ui/Avatar/index.vue +1 -1
  15. package/app/components/ui/Avatar/types.ts +5 -2
  16. package/app/components/ui/Badge/index.stories.ts +41 -41
  17. package/app/components/ui/Badge/index.vue +1 -1
  18. package/app/components/ui/Badge/types.ts +3 -1
  19. package/app/components/ui/Breadcrumb/index.stories.ts +48 -37
  20. package/app/components/ui/Breadcrumb/index.vue +1 -1
  21. package/app/components/ui/Button/index.stories.ts +94 -90
  22. package/app/components/ui/Button/index.vue +1 -1
  23. package/app/components/ui/Button/types.ts +4 -1
  24. package/app/components/ui/ButtonGroup/index.stories.ts +61 -49
  25. package/app/components/ui/Card/index.stories.ts +55 -47
  26. package/app/components/ui/Card/index.vue +1 -1
  27. package/app/components/ui/Checkbox/index.stories.ts +69 -46
  28. package/app/components/ui/Checkbox/index.vue +1 -1
  29. package/app/components/ui/CopyButton/index.stories.ts +89 -31
  30. package/app/components/ui/DataTable/index.stories.ts +218 -168
  31. package/app/components/ui/DataTable/index.vue +1 -1
  32. package/app/components/ui/DatePicker/index.stories.ts +131 -37
  33. package/app/components/ui/DateRangePicker/index.stories.ts +107 -33
  34. package/app/components/ui/Divider/index.stories.ts +46 -24
  35. package/app/components/ui/Divider/index.vue +1 -1
  36. package/app/components/ui/Drawer/index.stories.ts +131 -81
  37. package/app/components/ui/Drawer/index.vue +1 -7
  38. package/app/components/ui/Drawer/types.ts +1 -1
  39. package/app/components/ui/Dropdown/index.stories.ts +134 -89
  40. package/app/components/ui/Dropdown/index.vue +5 -1
  41. package/app/components/ui/Dropdown/types.ts +1 -1
  42. package/app/components/ui/FormItem/index.stories.ts +87 -43
  43. package/app/components/ui/FormItem/index.vue +1 -1
  44. package/app/components/ui/Help/index.stories.ts +46 -35
  45. package/app/components/ui/Icon/index.stories.ts +41 -43
  46. package/app/components/ui/Input/index.stories.ts +95 -41
  47. package/app/components/ui/Input/index.vue +1 -1
  48. package/app/components/ui/InputCurrency/index.stories.ts +89 -49
  49. package/app/components/ui/InputNumber/index.stories.ts +93 -29
  50. package/app/components/ui/InputNumber/index.vue +1 -1
  51. package/app/components/ui/InputOtp/index.stories.ts +6 -7
  52. package/app/components/ui/InputOtp/index.vue +1 -1
  53. package/app/components/ui/InputPercent/index.stories.ts +6 -7
  54. package/app/components/ui/InputRange/index.stories.ts +6 -7
  55. package/app/components/ui/Loading/index.stories.ts +19 -19
  56. package/app/components/ui/Markdown/index.stories.ts +7 -10
  57. package/app/components/ui/Modal/index.stories.ts +135 -80
  58. package/app/components/ui/Modal/index.vue +1 -6
  59. package/app/components/ui/Modal/types.ts +1 -1
  60. package/app/components/ui/ModalContent/index.stories.ts +54 -26
  61. package/app/components/ui/ModalContent/index.vue +2 -2
  62. package/app/components/ui/PageCard/index.stories.ts +177 -67
  63. package/app/components/ui/Pagination/index.stories.ts +68 -51
  64. package/app/components/ui/Pagination/index.vue +2 -2
  65. package/app/components/ui/Popover/index.stories.ts +47 -45
  66. package/app/components/ui/Popover/index.vue +1 -1
  67. package/app/components/ui/Qrcode/index.stories.ts +42 -34
  68. package/app/components/ui/RadioCardGroup/index.stories.ts +23 -32
  69. package/app/components/ui/RadioCardGroup/index.vue +1 -1
  70. package/app/components/ui/RadioGroup/index.stories.ts +123 -0
  71. package/app/components/ui/RadioGroup/index.vue +73 -0
  72. package/app/components/ui/RadioGroup/types.ts +13 -0
  73. package/app/components/ui/ScrollArea/index.stories.ts +69 -37
  74. package/app/components/ui/ScrollArea/index.vue +1 -1
  75. package/app/components/ui/SearchSelect/index.stories.ts +104 -66
  76. package/app/components/ui/Select/index.stories.ts +152 -98
  77. package/app/components/ui/Select/index.vue +3 -3
  78. package/app/components/ui/Skeleton/index.stories.ts +27 -30
  79. package/app/components/ui/Skeleton/index.vue +1 -1
  80. package/app/components/ui/Slider/index.stories.ts +73 -31
  81. package/app/components/ui/Slider/index.vue +1 -1
  82. package/app/components/ui/Surface/index.stories.ts +47 -21
  83. package/app/components/ui/Surface/index.vue +39 -28
  84. package/app/components/ui/Surface/types.ts +2 -2
  85. package/app/components/ui/Switch/index.stories.ts +6 -7
  86. package/app/components/ui/Switch/index.vue +1 -1
  87. package/app/components/ui/Tabs/index.stories.ts +103 -61
  88. package/app/components/ui/Tabs/index.vue +1 -1
  89. package/app/components/ui/Tag/index.stories.ts +42 -25
  90. package/app/components/ui/Tag/index.vue +39 -28
  91. package/app/components/ui/Tag/types.ts +2 -2
  92. package/app/components/ui/Textarea/index.stories.ts +73 -9
  93. package/app/components/ui/Textarea/index.vue +1 -1
  94. package/app/components/ui/Toast/index.stories.ts +71 -18
  95. package/app/components/ui/Toast/index.vue +1 -1
  96. package/app/components/ui/Tooltip/index.stories.ts +45 -38
  97. package/app/components/ui/Tooltip/index.vue +1 -1
  98. package/app/components/ui/WebLink/index.stories.ts +76 -41
  99. package/app/components/ui/WebLink/index.vue +1 -1
  100. package/package.json +2 -2
  101. package/app/components/ui/Radio/index.stories.ts +0 -71
  102. package/app/components/ui/Radio/index.vue +0 -10
  103. package/app/components/ui/Radio/types.ts +0 -3
@@ -1,74 +1,114 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
2
  import InputCurrency from './index.vue'
3
3
 
4
+ const currencyDisplays = [ 'symbol', 'narrowSymbol', 'code', 'name' ] as const
5
+
4
6
  const meta = {
5
7
  title: 'UI/InputCurrency',
6
8
  component: InputCurrency,
7
9
  argTypes: {
8
- disabled: { control: 'boolean' },
10
+ currency: { control: 'text' },
11
+ currencyDisplay: { control: 'select', options: currencyDisplays },
9
12
  },
10
13
  args: {
11
- disabled: false,
14
+ currency: 'JPY',
15
+ currencyDisplay: 'symbol',
12
16
  },
13
- } satisfies Meta
17
+ render: args => ({
18
+ components: { InputCurrency },
19
+ setup () {
20
+ const value = ref(1000)
21
+ return { args, value }
22
+ },
23
+ template: `
24
+ <div class="max-w-xs">
25
+ <InputCurrency v-model="value" v-bind="args" />
26
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
27
+ </div>
28
+ `,
29
+ }),
30
+ } satisfies Meta<typeof InputCurrency>
14
31
 
15
32
  export default meta
16
33
  type Story = StoryObj<typeof meta>
17
34
 
18
- export const Default: Story = {
19
- render: args => ({
35
+ export const Default: Story = {}
36
+
37
+ export const UsdSymbol: Story = {
38
+ render: () => ({
20
39
  components: { InputCurrency },
21
40
  setup () {
22
- const jpy = ref(1000)
23
- const usd = ref(49.99)
24
- const eurCode = ref(29.99)
25
- const cadSymbol = ref(79.99)
26
- const cadNarrow = ref(79.99)
27
- const jpyName = ref(5000)
28
- return { args, jpy, usd, eurCode, cadSymbol, cadNarrow, jpyName }
41
+ const value = ref(49.99)
42
+ return { value }
29
43
  },
30
44
  template: `
31
- <div class="space-y-10 max-w-xs">
32
- <!-- Controlled -->
33
- <section>
34
- <h3 class="mb-4 text-lg font-medium">Controlled</h3>
35
- <InputCurrency v-model="jpy" v-bind="args" />
36
- <div class="mt-2 text-sm text-muted-foreground">Value: {{ jpy }}</div>
37
- </section>
38
-
39
- <!-- USD (symbol) -->
40
- <section>
41
- <h3 class="mb-4 text-lg font-medium">USD (symbol)</h3>
42
- <InputCurrency v-model="usd" currency="USD" />
43
- <div class="mt-2 text-sm text-muted-foreground">Value: {{ usd }}</div>
44
- </section>
45
+ <div class="max-w-xs">
46
+ <InputCurrency v-model="value" currency="USD" />
47
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
48
+ </div>
49
+ `,
50
+ }),
51
+ }
45
52
 
46
- <!-- EUR (code display) -->
47
- <section>
48
- <h3 class="mb-4 text-lg font-medium">EUR (code display)</h3>
49
- <InputCurrency v-model="eurCode" currency="EUR" currencyDisplay="code" />
50
- <div class="mt-2 text-sm text-muted-foreground">Value: {{ eurCode }}</div>
51
- </section>
53
+ export const EurCodeDisplay: Story = {
54
+ render: () => ({
55
+ components: { InputCurrency },
56
+ setup () {
57
+ const value = ref(29.99)
58
+ return { value }
59
+ },
60
+ template: `
61
+ <div class="max-w-xs">
62
+ <InputCurrency v-model="value" currency="EUR" currencyDisplay="code" />
63
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
64
+ </div>
65
+ `,
66
+ }),
67
+ }
52
68
 
53
- <!-- CAD symbol vs narrowSymbol -->
54
- <section>
55
- <h3 class="mb-4 text-lg font-medium">CAD (symbol → CA$)</h3>
56
- <InputCurrency v-model="cadSymbol" currency="CAD" currencyDisplay="symbol" />
57
- <div class="mt-2 text-sm text-muted-foreground">Value: {{ cadSymbol }}</div>
58
- </section>
69
+ export const CadSymbol: Story = {
70
+ render: () => ({
71
+ components: { InputCurrency },
72
+ setup () {
73
+ const value = ref(79.99)
74
+ return { value }
75
+ },
76
+ template: `
77
+ <div class="max-w-xs">
78
+ <InputCurrency v-model="value" currency="CAD" currencyDisplay="symbol" />
79
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
80
+ </div>
81
+ `,
82
+ }),
83
+ }
59
84
 
60
- <section>
61
- <h3 class="mb-4 text-lg font-medium">CAD (narrowSymbol → $)</h3>
62
- <InputCurrency v-model="cadNarrow" currency="CAD" currencyDisplay="narrowSymbol" />
63
- <div class="mt-2 text-sm text-muted-foreground">Value: {{ cadNarrow }}</div>
64
- </section>
85
+ export const CadNarrowSymbol: Story = {
86
+ render: () => ({
87
+ components: { InputCurrency },
88
+ setup () {
89
+ const value = ref(79.99)
90
+ return { value }
91
+ },
92
+ template: `
93
+ <div class="max-w-xs">
94
+ <InputCurrency v-model="value" currency="CAD" currencyDisplay="narrowSymbol" />
95
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
96
+ </div>
97
+ `,
98
+ }),
99
+ }
65
100
 
66
- <!-- JPY (name display) -->
67
- <section>
68
- <h3 class="mb-4 text-lg font-medium">JPY (name display)</h3>
69
- <InputCurrency v-model="jpyName" currencyDisplay="name" />
70
- <div class="mt-2 text-sm text-muted-foreground">Value: {{ jpyName }}</div>
71
- </section>
101
+ export const JpyNameDisplay: Story = {
102
+ render: () => ({
103
+ components: { InputCurrency },
104
+ setup () {
105
+ const value = ref(5000)
106
+ return { value }
107
+ },
108
+ template: `
109
+ <div class="max-w-xs">
110
+ <InputCurrency v-model="value" currencyDisplay="name" />
111
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
72
112
  </div>
73
113
  `,
74
114
  }),
@@ -5,51 +5,115 @@ const meta = {
5
5
  title: 'UI/InputNumber',
6
6
  component: InputNumber,
7
7
  argTypes: {
8
+ min: { control: 'number' },
9
+ max: { control: 'number' },
10
+ step: { control: 'number' },
11
+ placeholder: { control: 'text' },
12
+ showButtons: { control: 'boolean' },
8
13
  disabled: { control: 'boolean' },
9
14
  invalid: { control: 'boolean' },
10
- showButtons: { control: 'boolean' },
11
15
  },
12
16
  args: {
17
+ min: undefined,
18
+ max: undefined,
19
+ step: 1,
20
+ placeholder: '',
21
+ showButtons: true,
13
22
  disabled: false,
14
23
  invalid: false,
15
- showButtons: true,
16
24
  },
25
+ render: args => ({
26
+ components: { InputNumber },
27
+ setup () {
28
+ const value = ref(0)
29
+ return { args, value }
30
+ },
31
+ template: `
32
+ <div class="max-w-xs">
33
+ <InputNumber v-model="value" v-bind="args" />
34
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
35
+ </div>
36
+ `,
37
+ }),
17
38
  } satisfies Meta<typeof InputNumber>
18
39
 
19
40
  export default meta
20
41
  type Story = StoryObj<typeof meta>
21
42
 
22
- export const Default: Story = {
23
- render: args => ({
43
+ export const Default: Story = {}
44
+
45
+ export const WithMinMax: Story = {
46
+ render: () => ({
47
+ components: { InputNumber },
48
+ setup () {
49
+ const value = ref(5)
50
+ return { value }
51
+ },
52
+ template: `
53
+ <div class="max-w-xs">
54
+ <InputNumber v-model="value" :min="0" :max="10" />
55
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
56
+ </div>
57
+ `,
58
+ }),
59
+ }
60
+
61
+ export const CustomStep: Story = {
62
+ render: () => ({
63
+ components: { InputNumber },
64
+ setup () {
65
+ const value = ref(0)
66
+ return { value }
67
+ },
68
+ template: `
69
+ <div class="max-w-xs">
70
+ <InputNumber v-model="value" :step="5" />
71
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ value }}</div>
72
+ </div>
73
+ `,
74
+ }),
75
+ }
76
+
77
+ export const WithoutButtons: Story = {
78
+ render: () => ({
79
+ components: { InputNumber },
80
+ setup () {
81
+ const value = ref(0)
82
+ return { value }
83
+ },
84
+ template: `
85
+ <div class="max-w-xs">
86
+ <InputNumber v-model="value" :showButtons="false" />
87
+ </div>
88
+ `,
89
+ }),
90
+ }
91
+
92
+ export const Disabled: Story = {
93
+ render: () => ({
94
+ components: { InputNumber },
95
+ setup () {
96
+ const value = ref(0)
97
+ return { value }
98
+ },
99
+ template: `
100
+ <div class="max-w-xs">
101
+ <InputNumber v-model="value" disabled />
102
+ </div>
103
+ `,
104
+ }),
105
+ }
106
+
107
+ export const Invalid: Story = {
108
+ render: () => ({
24
109
  components: { InputNumber },
25
110
  setup () {
26
- const basic = ref(0)
27
- const minMax = ref(5)
28
- const stepped = ref(0)
29
- return { args, basic, minMax, stepped }
111
+ const value = ref(0)
112
+ return { value }
30
113
  },
31
114
  template: `
32
- <div class="space-y-10 max-w-xs">
33
- <!-- Controlled -->
34
- <section>
35
- <h3 class="mb-4 text-lg font-medium">Controlled</h3>
36
- <InputNumber v-model="basic" v-bind="args" />
37
- <div class="mt-2 text-sm text-muted-foreground">Value: {{ basic }}</div>
38
- </section>
39
-
40
- <!-- With Min / Max -->
41
- <section>
42
- <h3 class="mb-4 text-lg font-medium">With Min / Max (0 - 10)</h3>
43
- <InputNumber v-model="minMax" :min="0" :max="10" />
44
- <div class="mt-2 text-sm text-muted-foreground">Value: {{ minMax }}</div>
45
- </section>
46
-
47
- <!-- Custom Step -->
48
- <section>
49
- <h3 class="mb-4 text-lg font-medium">Custom Step (5)</h3>
50
- <InputNumber v-model="stepped" :step="5" />
51
- <div class="mt-2 text-sm text-muted-foreground">Value: {{ stepped }}</div>
52
- </section>
115
+ <div class="max-w-xs">
116
+ <InputNumber v-model="value" invalid />
53
117
  </div>
54
118
  `,
55
119
  }),
@@ -5,7 +5,7 @@ import {
5
5
  NumberFieldDecrement,
6
6
  NumberFieldIncrement,
7
7
  NumberFieldInput,
8
- } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/number-field'
8
+ } from '../../shadcn/number-field'
9
9
  import type { InputNumberProps } from './types'
10
10
 
11
11
  const props = withDefaults(defineProps<InputNumberProps>(), {
@@ -12,12 +12,6 @@ const meta = {
12
12
  disabled: false,
13
13
  length: 6,
14
14
  },
15
- } satisfies Meta<typeof InputOtp>
16
-
17
- export default meta
18
- type Story = StoryObj<typeof meta>
19
-
20
- export const Default: Story = {
21
15
  render: args => ({
22
16
  components: { InputOtp },
23
17
  setup () {
@@ -36,4 +30,9 @@ export const Default: Story = {
36
30
  </div>
37
31
  `,
38
32
  }),
39
- }
33
+ } satisfies Meta<typeof InputOtp>
34
+
35
+ export default meta
36
+ type Story = StoryObj<typeof meta>
37
+
38
+ export const Default: Story = {}
@@ -3,7 +3,7 @@ import {
3
3
  PinInput,
4
4
  PinInputGroup,
5
5
  PinInputSlot,
6
- } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/pin-input'
6
+ } from '../../shadcn/pin-input'
7
7
  import type { InputOtpProps } from './types'
8
8
 
9
9
  withDefaults(defineProps<InputOtpProps>(), {
@@ -10,12 +10,6 @@ const meta = {
10
10
  args: {
11
11
  disabled: false,
12
12
  },
13
- } satisfies Meta
14
-
15
- export default meta
16
- type Story = StoryObj<typeof meta>
17
-
18
- export const Default: Story = {
19
13
  render: args => ({
20
14
  components: { InputPercent },
21
15
  setup () {
@@ -29,4 +23,9 @@ export const Default: Story = {
29
23
  </div>
30
24
  `,
31
25
  }),
32
- }
26
+ } satisfies Meta
27
+
28
+ export default meta
29
+ type Story = StoryObj<typeof meta>
30
+
31
+ export const Default: Story = {}
@@ -14,12 +14,6 @@ const meta = {
14
14
  min: 0,
15
15
  max: 100,
16
16
  },
17
- } satisfies Meta<typeof InputRange>
18
-
19
- export default meta
20
- type Story = StoryObj<typeof meta>
21
-
22
- export const Default: Story = {
23
17
  render: args => ({
24
18
  components: { InputRange },
25
19
  setup () {
@@ -34,4 +28,9 @@ export const Default: Story = {
34
28
  </div>
35
29
  `,
36
30
  }),
37
- }
31
+ } satisfies Meta<typeof InputRange>
32
+
33
+ export default meta
34
+ type Story = StoryObj<typeof meta>
35
+
36
+ export const Default: Story = {}
@@ -4,32 +4,32 @@ import Loading from './index.vue'
4
4
  const meta = {
5
5
  title: 'UI/Loading',
6
6
  component: Loading,
7
+ argTypes: {
8
+ class: { control: 'text' },
9
+ },
10
+ args: {
11
+ class: '',
12
+ },
13
+ render: args => ({
14
+ components: { Loading },
15
+ setup: () => ({ args }),
16
+ template: '<Loading :class="args.class" />',
17
+ }),
7
18
  } satisfies Meta<typeof Loading>
8
19
 
9
20
  export default meta
10
21
  type Story = StoryObj<typeof meta>
11
22
 
12
- export const Default: Story = {
13
- render: args => ({
23
+ export const Default: Story = {}
24
+
25
+ export const CustomSize: Story = {
26
+ render: () => ({
14
27
  components: { Loading },
15
- setup: () => ({ args }),
16
28
  template: `
17
- <div class="space-y-10">
18
- <!-- Default -->
19
- <section>
20
- <h3 class="mb-4 text-lg font-medium">Default</h3>
21
- <Loading />
22
- </section>
23
-
24
- <!-- Custom Size -->
25
- <section>
26
- <h3 class="mb-4 text-lg font-medium">Custom Size</h3>
27
- <div class="flex items-end gap-6">
28
- <Loading class="size-6" />
29
- <Loading class="size-10" />
30
- <Loading class="size-16" />
31
- </div>
32
- </section>
29
+ <div class="flex items-end gap-6">
30
+ <Loading class="size-6" />
31
+ <Loading class="size-10" />
32
+ <Loading class="size-16" />
33
33
  </div>
34
34
  `,
35
35
  }),
@@ -10,17 +10,9 @@ const meta = {
10
10
  args: {
11
11
  hideTitle: false,
12
12
  },
13
- } satisfies Meta<typeof Markdown>
14
-
15
- export default meta
16
- type Story = StoryObj<typeof meta>
17
-
18
- export const Default: Story = {
19
13
  render: args => ({
20
14
  components: { Markdown },
21
- setup () {
22
- return { args }
23
- },
15
+ setup: () => ({ args }),
24
16
  template: `
25
17
  <Markdown v-bind="args">
26
18
  <h1>Document Title</h1>
@@ -49,4 +41,9 @@ console.log(greeting)</code></pre>
49
41
  </Markdown>
50
42
  `,
51
43
  }),
52
- }
44
+ } satisfies Meta<typeof Markdown>
45
+
46
+ export default meta
47
+ type Story = StoryObj<typeof meta>
48
+
49
+ export const Default: Story = {}