@alexgorbatchev/shadcn 0.0.49 → 0.0.51

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 (34) hide show
  1. package/README.md +2 -2
  2. package/dist/{chunk-jhvy8jay.js → chunk-268pbhj1.js} +361 -434
  3. package/dist/{chunk-880zr7gb.js → chunk-p894n7r6.js} +9 -22
  4. package/dist/{chunk-t6w8vcvf.js → chunk-rc99vk8d.js} +19 -1
  5. package/dist/chunk-xfryhw7e.js +225 -0
  6. package/dist/{chunk-trwye0d6.js → chunk-yrp7xtb5.js} +21 -1
  7. package/dist/{chunk-62ggz655.js → chunk-zs4h45d8.js} +8 -9
  8. package/dist/components/FilterBar.d.ts +2 -0
  9. package/dist/components/OptionSelect.d.ts +29 -0
  10. package/dist/components/PageIntro.d.ts +22 -0
  11. package/dist/components/assistant-ui/native/McpConfigDialog.js +2 -1
  12. package/dist/components/assistant-ui/native/index.js +2 -1
  13. package/dist/components/calendar/Calendar.d.ts +3 -2
  14. package/dist/components/calendar/index.js +2 -1
  15. package/dist/components/data-grid/index.js +2 -2
  16. package/dist/components/gantt/index.js +9 -19
  17. package/dist/components/json-render/index.js +9 -8
  18. package/dist/components/persian-calendar/index.js +5 -3
  19. package/dist/components/virtual-data-grid/index.js +2 -2
  20. package/dist/index.d.ts +4 -1
  21. package/dist/index.js +18 -20
  22. package/dist/prototype.js +1 -1
  23. package/llms/components/data-display/Table.md +1 -1
  24. package/llms/components/forms/OptionSelect.md +100 -0
  25. package/llms/components/layout/PageIntro.md +102 -0
  26. package/llms/components/navigation/ContextMenu.md +25 -25
  27. package/llms/setup.md +2 -2
  28. package/llms.txt +2 -1
  29. package/package.json +1 -1
  30. package/templates/prototype/src/components/Workbench.tsx +45 -35
  31. package/templates/prototype/src/prototypes/dashboard/components/Dashboard.tsx +8 -7
  32. package/dist/chunk-sp4g23m0.js +0 -60
  33. package/dist/components/NativeSelect.d.ts +0 -12
  34. package/llms/components/forms/NativeSelect.md +0 -136
@@ -1,60 +0,0 @@
1
- import {
2
- cn2
3
- } from "./chunk-en44w1pn.js";
4
- import {
5
- useAnalyticsCallback
6
- } from "./chunk-5mydsjp3.js";
7
-
8
- // src/components/NativeSelect.tsx
9
- import { ChevronDownIcon } from "lucide-react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
- function NativeSelect2({
12
- analytics,
13
- density,
14
- className,
15
- dir,
16
- size = "default",
17
- ...props
18
- }) {
19
- const trackedOnChange = useAnalyticsCallback("NativeSelect", analytics, { name: "ui.change-request" }, props.onChange);
20
- return /* @__PURE__ */ jsxs("div", {
21
- dir,
22
- className: cn2("group/native-select relative w-fit has-[select:disabled]:opacity-50", className),
23
- "data-density": density,
24
- "data-slot": "native-select-wrapper",
25
- "data-size": size,
26
- children: [
27
- /* @__PURE__ */ jsx("select", {
28
- dir,
29
- "data-slot": "native-select",
30
- "data-size": size,
31
- className: "h-control w-full min-w-0 appearance-none rounded-sm border border-input bg-secondary py-0 pe-8 ps-2.5 text-sm transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive data-[size=sm]:h-control-sm data-[size=sm]:rounded-sm",
32
- ...props,
33
- onChange: trackedOnChange
34
- }),
35
- /* @__PURE__ */ jsx(ChevronDownIcon, {
36
- className: "pointer-events-none absolute top-1/2 end-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none",
37
- "aria-hidden": "true",
38
- "data-slot": "native-select-icon"
39
- })
40
- ]
41
- });
42
- }
43
- function NativeSelectOption2({ density, className, ...props }) {
44
- return /* @__PURE__ */ jsx("option", {
45
- "data-density": density,
46
- "data-slot": "native-select-option",
47
- className: cn2("bg-[Canvas] text-[CanvasText]", className),
48
- ...props
49
- });
50
- }
51
- function NativeSelectOptGroup2({ density, className, ...props }) {
52
- return /* @__PURE__ */ jsx("optgroup", {
53
- "data-density": density,
54
- "data-slot": "native-select-optgroup",
55
- className: cn2("bg-[Canvas] text-[CanvasText]", className),
56
- ...props
57
- });
58
- }
59
-
60
- export { NativeSelect2, NativeSelectOption2, NativeSelectOptGroup2 };
@@ -1,12 +0,0 @@
1
- import type { IAnalyticsProps } from "../analytics/types.js";
2
- import type { IDensityProps } from "../density/types.js";
3
- import type { ComponentProps, ReactElement } from "react";
4
- type NativeSelectProps = Omit<ComponentProps<"select">, "size"> & {
5
- size?: "sm" | "default";
6
- };
7
- declare function NativeSelect({ analytics, density, className, dir, size, ...props }: NativeSelectProps & IDensityProps & IAnalyticsProps): ReactElement;
8
- type NativeSelectOptionProps = ComponentProps<"option"> & IDensityProps;
9
- declare function NativeSelectOption({ density, className, ...props }: NativeSelectOptionProps): ReactElement;
10
- type NativeSelectOptGroupProps = ComponentProps<"optgroup"> & IDensityProps;
11
- declare function NativeSelectOptGroup({ density, className, ...props }: NativeSelectOptGroupProps): ReactElement;
12
- export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
@@ -1,136 +0,0 @@
1
- # NativeSelect
2
-
3
- Story: @alexgorbatchev/shadcn/components/forms/NativeSelect
4
- Source: src/components/stories/forms/NativeSelect.stories.tsx
5
-
6
- [Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/NativeSelect.stories.tsx)
7
-
8
- ## Public imports
9
-
10
- ```tsx
11
- import { NativeSelect, NativeSelectOption, NativeSelectOptGroup, Button, Field, FieldGroup, FieldLabel, FieldError } from "@alexgorbatchev/shadcn";
12
- ```
13
-
14
- ## Default component
15
-
16
- ```tsx
17
- NativeSelect
18
- ```
19
-
20
- ## Story controls
21
-
22
- ```tsx
23
- { size: { control: "select", options: ["default", "sm"] } }
24
- ```
25
-
26
- ## Default args
27
-
28
- ```tsx
29
- { "aria-label": "Runtime", defaultValue: "bun", onChange: fn() }
30
- ```
31
-
32
- ## Default render
33
-
34
- ```tsx
35
- (args) => (<NativeSelect {...args}>
36
- <NativeSelectOptGroup label="JavaScript">
37
- <NativeSelectOption value="bun">Bun</NativeSelectOption>
38
- <NativeSelectOption value="node">Node</NativeSelectOption>
39
- <NativeSelectOption value="deno" disabled>
40
- Deno
41
- </NativeSelectOption>
42
- </NativeSelectOptGroup>
43
- </NativeSelect>)
44
- ```
45
-
46
- ## Examples
47
-
48
- Storybook CSF excerpts. Default args and render apply unless overridden. Local helpers, fixtures, decorators, and providers may be required; these are reference excerpts, not standalone consumer modules. Interaction tests are omitted.
49
-
50
- ### Default
51
-
52
- ```tsx
53
- {}
54
- ```
55
-
56
- ### Small
57
-
58
- ```tsx
59
- {
60
- args: { size: "sm" }
61
- }
62
- ```
63
-
64
- ### Compact
65
-
66
- ```tsx
67
- {
68
- args: { density: "compact" }
69
- }
70
- ```
71
-
72
- ### CompactSmall
73
-
74
- ```tsx
75
- {
76
- args: { density: "compact", size: "sm" }
77
- }
78
- ```
79
-
80
- ### Disabled
81
-
82
- ```tsx
83
- {
84
- args: { disabled: true }
85
- }
86
- ```
87
-
88
- ### Invalid
89
-
90
- ```tsx
91
- {
92
- render: (args) => (<Field data-invalid>
93
- <FieldLabel htmlFor="invalid-runtime">Runtime</FieldLabel>
94
- <NativeSelect {...args} id="invalid-runtime" aria-invalid="true" aria-describedby="runtime-error">
95
- <NativeSelectOption value="bun">Bun</NativeSelectOption>
96
- <NativeSelectOption value="node">Node</NativeSelectOption>
97
- </NativeSelect>
98
- <FieldError id="runtime-error">Choose a supported runtime.</FieldError>
99
- </Field>)
100
- }
101
- ```
102
-
103
- ### RightToLeft
104
-
105
- ```tsx
106
- {
107
- args: { dir: "rtl" }
108
- }
109
- ```
110
-
111
- ### NativeForm
112
-
113
- ```tsx
114
- {
115
- render: (args) => (<form onSubmit={(event) => {
116
- event.preventDefault();
117
- onSubmit(new FormData(event.currentTarget).get("runtime"));
118
- }}>
119
- <FieldGroup>
120
- <Field>
121
- <FieldLabel htmlFor="form-runtime">Runtime</FieldLabel>
122
- <NativeSelect {...args} id="form-runtime" name="runtime">
123
- <NativeSelectOption value="bun">Bun</NativeSelectOption>
124
- <NativeSelectOption value="node">Node</NativeSelectOption>
125
- </NativeSelect>
126
- </Field>
127
- <Field orientation="horizontal">
128
- <Button type="submit">Save runtime</Button>
129
- <Button type="reset" variant="outline">
130
- Reset runtime
131
- </Button>
132
- </Field>
133
- </FieldGroup>
134
- </form>)
135
- }
136
- ```