@alexgorbatchev/shadcn 0.0.104 → 0.0.106

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.
@@ -0,0 +1,110 @@
1
+ import {
2
+ useDensity
3
+ } from "./chunk-e6hk39ev.js";
4
+ import {
5
+ cn2
6
+ } from "./chunk-en44w1pn.js";
7
+ import {
8
+ useAnalyticsCallback
9
+ } from "./chunk-5mydsjp3.js";
10
+
11
+ // src/components/NumberField.tsx
12
+ import { NumberField as NumberFieldPrimitive } from "@base-ui/react/number-field";
13
+ import { MinusIcon, PlusIcon, MoveHorizontalIcon } from "lucide-react";
14
+ import { jsx } from "react/jsx-runtime";
15
+ function NumberField2({
16
+ analytics,
17
+ density,
18
+ className,
19
+ ...props
20
+ }) {
21
+ const trackedOnValueCommitted = useAnalyticsCallback("NumberField", analytics, { name: "ui.commit" }, props.onValueCommitted);
22
+ return /* @__PURE__ */ jsx(NumberFieldPrimitive.Root, {
23
+ "data-density": density,
24
+ "data-slot": "number-field",
25
+ className: (state) => cn2("flex min-w-0 flex-col gap-field-gap", typeof className === "function" ? className(state) : className),
26
+ ...props,
27
+ onValueCommitted: trackedOnValueCommitted
28
+ });
29
+ }
30
+ function NumberFieldGroup2({
31
+ density,
32
+ className,
33
+ ...props
34
+ }) {
35
+ return /* @__PURE__ */ jsx(NumberFieldPrimitive.Group, {
36
+ "data-density": density,
37
+ "data-slot": "number-field-group",
38
+ className: (state) => cn2("flex h-control min-w-0 items-stretch rounded-sm border border-input bg-secondary text-foreground transition-colors focus-within:border-ring focus-within:ring-1 focus-within:ring-ring data-disabled:opacity-50 motion-reduce:transition-none", typeof className === "function" ? className(state) : className),
39
+ ...props
40
+ });
41
+ }
42
+ function NumberFieldInput2({
43
+ density,
44
+ className,
45
+ ...props
46
+ }) {
47
+ return /* @__PURE__ */ jsx(NumberFieldPrimitive.Input, {
48
+ "data-density": density,
49
+ "data-slot": "number-field-input",
50
+ className: (state) => cn2("min-w-0 flex-1 bg-transparent px-control-x text-center text-sm tabular-nums outline-none disabled:cursor-not-allowed", typeof className === "function" ? className(state) : className),
51
+ ...props
52
+ });
53
+ }
54
+ function NumberFieldDecrement2({
55
+ density,
56
+ className,
57
+ children = /* @__PURE__ */ jsx(MinusIcon, {}),
58
+ ...props
59
+ }) {
60
+ return /* @__PURE__ */ jsx(NumberFieldPrimitive.Decrement, {
61
+ "data-density": density,
62
+ "data-slot": "number-field-decrement",
63
+ className: (state) => cn2("flex w-control shrink-0 items-center justify-center rounded-s-sm outline-none hover:bg-muted focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-3.5", typeof className === "function" ? className(state) : className),
64
+ ...props,
65
+ children
66
+ });
67
+ }
68
+ function NumberFieldIncrement2({
69
+ density,
70
+ className,
71
+ children = /* @__PURE__ */ jsx(PlusIcon, {}),
72
+ ...props
73
+ }) {
74
+ return /* @__PURE__ */ jsx(NumberFieldPrimitive.Increment, {
75
+ "data-density": density,
76
+ "data-slot": "number-field-increment",
77
+ className: (state) => cn2("flex w-control shrink-0 items-center justify-center rounded-e-sm outline-none hover:bg-muted focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-3.5", typeof className === "function" ? className(state) : className),
78
+ ...props,
79
+ children
80
+ });
81
+ }
82
+ function NumberFieldScrubArea2({
83
+ density,
84
+ className,
85
+ ...props
86
+ }) {
87
+ return /* @__PURE__ */ jsx(NumberFieldPrimitive.ScrubArea, {
88
+ "data-density": density,
89
+ "data-slot": "number-field-scrub-area",
90
+ className: (state) => cn2("flex w-fit cursor-ew-resize items-center gap-control-gap text-sm font-medium", typeof className === "function" ? className(state) : className),
91
+ ...props
92
+ });
93
+ }
94
+ function NumberFieldScrubAreaCursor2({
95
+ density,
96
+ className,
97
+ children = /* @__PURE__ */ jsx(MoveHorizontalIcon, {}),
98
+ ...props
99
+ }) {
100
+ const resolvedDensity = useDensity(density);
101
+ return /* @__PURE__ */ jsx(NumberFieldPrimitive.ScrubAreaCursor, {
102
+ "data-density": resolvedDensity,
103
+ "data-slot": "number-field-scrub-area-cursor",
104
+ className: (state) => cn2("z-50 font-sans text-sm text-foreground [&_svg]:size-5", typeof className === "function" ? className(state) : className),
105
+ ...props,
106
+ children
107
+ });
108
+ }
109
+
110
+ export { NumberField2, NumberFieldGroup2, NumberFieldInput2, NumberFieldDecrement2, NumberFieldIncrement2, NumberFieldScrubArea2, NumberFieldScrubAreaCursor2 };
@@ -5749,7 +5749,7 @@ var componentDefinitions2 = {
5749
5749
  defaultOpen: boolean2().nullable()
5750
5750
  }),
5751
5751
  slots: ["default"],
5752
- description: "Collapsible section with trigger. Children render inside."
5752
+ description: "Collapsible section with trigger. Children render inside and stay mounted but hidden while it is closed."
5753
5753
  },
5754
5754
  Dialog: {
5755
5755
  props: object({
@@ -6003,7 +6003,7 @@ var componentDefinitions2 = {
6003
6003
  value: string2().nullable()
6004
6004
  }),
6005
6005
  events: ["select"],
6006
- description: "Dropdown menu with trigger button and selectable items. Use { $bindState } on value for selected item binding."
6006
+ description: "Dropdown menu with trigger button and selectable items. Without a binding the label is the trigger's text and items are actions. With { $bindState } on value it is a choice: the label names the question above the trigger, the trigger shows the chosen item's label ('Choose…' before a choice) and the open menu marks the chosen item checked."
6007
6007
  },
6008
6008
  Toggle: {
6009
6009
  props: object({
@@ -273,103 +273,4 @@ function useComboboxAnchor2() {
273
273
  return useRef(null);
274
274
  }
275
275
 
276
- // src/components/NumberField.tsx
277
- import { NumberField as NumberFieldPrimitive } from "@base-ui/react/number-field";
278
- import { MinusIcon, PlusIcon, MoveHorizontalIcon } from "lucide-react";
279
- import { jsx as jsx2 } from "react/jsx-runtime";
280
- function NumberField2({
281
- analytics,
282
- density,
283
- className,
284
- ...props
285
- }) {
286
- const trackedOnValueCommitted = useAnalyticsCallback("NumberField", analytics, { name: "ui.commit" }, props.onValueCommitted);
287
- return /* @__PURE__ */ jsx2(NumberFieldPrimitive.Root, {
288
- "data-density": density,
289
- "data-slot": "number-field",
290
- className: (state) => cn2("flex min-w-0 flex-col gap-field-gap", typeof className === "function" ? className(state) : className),
291
- ...props,
292
- onValueCommitted: trackedOnValueCommitted
293
- });
294
- }
295
- function NumberFieldGroup2({
296
- density,
297
- className,
298
- ...props
299
- }) {
300
- return /* @__PURE__ */ jsx2(NumberFieldPrimitive.Group, {
301
- "data-density": density,
302
- "data-slot": "number-field-group",
303
- className: (state) => cn2("flex h-control min-w-0 items-stretch rounded-sm border border-input bg-secondary text-foreground transition-colors focus-within:border-ring focus-within:ring-1 focus-within:ring-ring data-disabled:opacity-50 motion-reduce:transition-none", typeof className === "function" ? className(state) : className),
304
- ...props
305
- });
306
- }
307
- function NumberFieldInput2({
308
- density,
309
- className,
310
- ...props
311
- }) {
312
- return /* @__PURE__ */ jsx2(NumberFieldPrimitive.Input, {
313
- "data-density": density,
314
- "data-slot": "number-field-input",
315
- className: (state) => cn2("min-w-0 flex-1 bg-transparent px-control-x text-center text-sm tabular-nums outline-none disabled:cursor-not-allowed", typeof className === "function" ? className(state) : className),
316
- ...props
317
- });
318
- }
319
- function NumberFieldDecrement2({
320
- density,
321
- className,
322
- children = /* @__PURE__ */ jsx2(MinusIcon, {}),
323
- ...props
324
- }) {
325
- return /* @__PURE__ */ jsx2(NumberFieldPrimitive.Decrement, {
326
- "data-density": density,
327
- "data-slot": "number-field-decrement",
328
- className: (state) => cn2("flex w-control shrink-0 items-center justify-center rounded-s-sm outline-none hover:bg-muted focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-3.5", typeof className === "function" ? className(state) : className),
329
- ...props,
330
- children
331
- });
332
- }
333
- function NumberFieldIncrement2({
334
- density,
335
- className,
336
- children = /* @__PURE__ */ jsx2(PlusIcon, {}),
337
- ...props
338
- }) {
339
- return /* @__PURE__ */ jsx2(NumberFieldPrimitive.Increment, {
340
- "data-density": density,
341
- "data-slot": "number-field-increment",
342
- className: (state) => cn2("flex w-control shrink-0 items-center justify-center rounded-e-sm outline-none hover:bg-muted focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-3.5", typeof className === "function" ? className(state) : className),
343
- ...props,
344
- children
345
- });
346
- }
347
- function NumberFieldScrubArea2({
348
- density,
349
- className,
350
- ...props
351
- }) {
352
- return /* @__PURE__ */ jsx2(NumberFieldPrimitive.ScrubArea, {
353
- "data-density": density,
354
- "data-slot": "number-field-scrub-area",
355
- className: (state) => cn2("flex w-fit cursor-ew-resize items-center gap-control-gap text-sm font-medium", typeof className === "function" ? className(state) : className),
356
- ...props
357
- });
358
- }
359
- function NumberFieldScrubAreaCursor2({
360
- density,
361
- className,
362
- children = /* @__PURE__ */ jsx2(MoveHorizontalIcon, {}),
363
- ...props
364
- }) {
365
- const resolvedDensity = useDensity(density);
366
- return /* @__PURE__ */ jsx2(NumberFieldPrimitive.ScrubAreaCursor, {
367
- "data-density": resolvedDensity,
368
- "data-slot": "number-field-scrub-area-cursor",
369
- className: (state) => cn2("z-50 font-sans text-sm text-foreground [&_svg]:size-5", typeof className === "function" ? className(state) : className),
370
- ...props,
371
- children
372
- });
373
- }
374
-
375
- export { Combobox2, ComboboxValue2, ComboboxTrigger2, ComboboxInput2, ComboboxContent2, ComboboxList2, ComboboxItem2, ComboboxGroup2, ComboboxLabel2, ComboboxCollection2, ComboboxEmpty2, ComboboxSeparator2, ComboboxChips2, ComboboxChip2, ComboboxChipsInput2, useComboboxAnchor2, NumberField2, NumberFieldGroup2, NumberFieldInput2, NumberFieldDecrement2, NumberFieldIncrement2, NumberFieldScrubArea2, NumberFieldScrubAreaCursor2 };
276
+ export { Combobox2, ComboboxValue2, ComboboxTrigger2, ComboboxInput2, ComboboxContent2, ComboboxList2, ComboboxItem2, ComboboxGroup2, ComboboxLabel2, ComboboxCollection2, ComboboxEmpty2, ComboboxSeparator2, ComboboxChips2, ComboboxChip2, ComboboxChipsInput2, useComboboxAnchor2 };