@datum-cloud/datum-ui 0.2.0-alpha.2 → 0.2.0-alpha.4
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.
- package/README.md +336 -0
- package/dist/alert/index.mjs +3 -0
- package/dist/alert-BC2Mccfo.mjs +95 -0
- package/dist/autocomplete/index.mjs +7 -0
- package/dist/autocomplete-DZtI97HP.mjs +295 -0
- package/dist/avatar-stack/index.mjs +5 -0
- package/dist/avatar-stack-JCfBlPB9.mjs +80 -0
- package/dist/badge/index.mjs +3 -0
- package/dist/badge-bFgeYceE.mjs +185 -0
- package/dist/breadcrumb/index.mjs +4 -0
- package/dist/breadcrumb-BGYJgom_.mjs +71 -0
- package/dist/button/index.mjs +4 -0
- package/dist/button-AzpnV-WB.mjs +49 -0
- package/dist/button-C1wRfGtT.mjs +230 -0
- package/dist/button-group/index.mjs +5 -0
- package/dist/button-group-C1IB2K5s.mjs +40 -0
- package/dist/calendar/index.mjs +5 -0
- package/dist/calendar-DlIHeWb0.mjs +113 -0
- package/dist/card/index.mjs +4 -0
- package/dist/card-3Kd0VdNf.mjs +63 -0
- package/dist/chart/index.mjs +4 -0
- package/dist/chart-BZqUKpkh.mjs +143 -0
- package/dist/checkbox/index.mjs +4 -0
- package/dist/checkbox-LG1OKTpG.mjs +34 -0
- package/dist/col-lrLMZaTJ.mjs +184 -0
- package/dist/collapsible/index.mjs +3 -0
- package/dist/collapsible-Bt9UYfv3.mjs +9 -0
- package/dist/command/index.mjs +5 -0
- package/dist/command-s0Yv3abE.mjs +86 -0
- package/dist/components/features/date-picker/index.d.ts +3 -0
- package/dist/components/features/date-picker/index.d.ts.map +1 -0
- package/dist/components/features/dropzone/index.d.ts +1 -0
- package/dist/components/features/dropzone/index.d.ts.map +1 -1
- package/dist/date-picker/index.mjs +9 -0
- package/dist/{datum.provider-D6VMjSV0.mjs → datum.provider-B77goJgl.mjs} +1 -1
- package/dist/dialog/index.mjs +5 -0
- package/dist/dialog-DXBaT9gA.mjs +86 -0
- package/dist/dialog-bnMMf9GD.mjs +73 -0
- package/dist/dropdown/index.mjs +3 -0
- package/dist/dropdown-DtSa_lqc.mjs +112 -0
- package/dist/dropzone/index.mjs +5 -0
- package/dist/dropzone-BkOnwrS4.mjs +221 -0
- package/dist/empty-content/index.mjs +3 -0
- package/dist/empty-content-BM9rzI13.mjs +196 -0
- package/dist/exports/map.d.ts +3 -0
- package/dist/exports/map.d.ts.map +1 -0
- package/dist/form/index.mjs +146 -0
- package/dist/grid/index.mjs +3 -0
- package/dist/hooks/index.mjs +2 -3
- package/dist/hover-card/index.mjs +4 -0
- package/dist/hover-card-CUPfFUqE.mjs +33 -0
- package/dist/icon-wrapper-9ticVbRL.mjs +14 -0
- package/dist/icons/index.mjs +3 -3
- package/dist/index.mjs +66 -8
- package/dist/input/index.mjs +5 -0
- package/dist/input-DuyjEKEW.mjs +17 -0
- package/dist/input-fzXBheCN.mjs +17 -0
- package/dist/input-group/index.mjs +7 -0
- package/dist/input-group-CPaFSTEV.mjs +80 -0
- package/dist/input-number/index.mjs +6 -0
- package/dist/input-number-9o62JHRl.mjs +106 -0
- package/dist/input-with-addons/index.mjs +3 -0
- package/dist/input-with-addons-BQn7KCTU.mjs +30 -0
- package/dist/label/index.mjs +4 -0
- package/dist/label-_ste_Re3.mjs +44 -0
- package/dist/link-button-TIF2Zdrk.mjs +36 -0
- package/dist/loader-overlay/index.mjs +3 -0
- package/dist/loader-overlay-DUaQSZQP.mjs +17 -0
- package/dist/map/index.mjs +13 -0
- package/dist/map-Df8QMcX0.mjs +1094 -0
- package/dist/more-actions/index.mjs +5 -0
- package/dist/more-actions-Ch1f6Mh3.mjs +54 -0
- package/dist/nprogress/index.mjs +32 -0
- package/dist/page-title/index.mjs +3 -0
- package/dist/page-title-BJuo81rT.mjs +26 -0
- package/dist/popover/index.mjs +4 -0
- package/dist/popover-SQlKSz6L.mjs +36 -0
- package/dist/provider/index.mjs +4 -0
- package/dist/radio-group/index.mjs +4 -0
- package/dist/radio-group-Oshv0b-U.mjs +49 -0
- package/dist/select/index.mjs +4 -0
- package/dist/select-DVlEzD2W.mjs +166 -0
- package/dist/separator/index.mjs +4 -0
- package/dist/separator-T2ppyD-8.mjs +18 -0
- package/dist/sheet/index.mjs +5 -0
- package/dist/sheet-BKiCwtNO.mjs +45 -0
- package/dist/sheet-CtnP6gTD.mjs +77 -0
- package/dist/sidebar/index.mjs +11 -0
- package/dist/sidebar-DfqezV8t.mjs +945 -0
- package/dist/skeleton/index.mjs +4 -0
- package/dist/skeleton-vzbxA-DQ.mjs +13 -0
- package/dist/spinner/index.mjs +4 -0
- package/dist/spinner-BE7k2bAD.mjs +16 -0
- package/dist/{icon-wrapper-BgPkifId.mjs → spinner.icon-Bg8zgGh0.mjs} +1 -12
- package/dist/stepper/index.mjs +5 -0
- package/dist/stepper-SWB-u_nM.mjs +323 -0
- package/dist/style.css +3 -0
- package/dist/switch/index.mjs +4 -0
- package/dist/switch-Calk7Gyw.mjs +32 -0
- package/dist/table/index.mjs +4 -0
- package/dist/table-CsXBcQLI.mjs +68 -0
- package/dist/tabs/index.mjs +3 -0
- package/dist/tabs-D8n-dqnw.mjs +52 -0
- package/dist/tag-input/index.mjs +5 -0
- package/dist/tag-input-Di7SDNbK.mjs +284 -0
- package/dist/task-queue/index.mjs +7 -0
- package/dist/task-queue-dropdown-DW72ikDH.mjs +1356 -0
- package/dist/textarea/index.mjs +5 -0
- package/dist/textarea-CxE3YbC7.mjs +17 -0
- package/dist/textarea-QYRcDEpK.mjs +15 -0
- package/dist/theme/index.mjs +4 -0
- package/dist/theme-script-XBouzsNR.mjs +66 -0
- package/dist/to-api-format-C2xjQUcI.mjs +1506 -0
- package/dist/toast/index.mjs +3 -0
- package/dist/tooltip/index.mjs +4 -0
- package/dist/tooltip-Dd3ActSS.mjs +74 -0
- package/dist/typography/index.mjs +3 -0
- package/dist/typography-UA7ZZvgJ.mjs +200 -0
- package/dist/use-copy-to-clipboard-ki-WoTml.mjs +31 -0
- package/dist/use-stepper-BaToCYMs.mjs +2017 -0
- package/dist/{use-copy-to-clipboard-BfrpD6G8.mjs → use-toast-mdn_CqRY.mjs} +34 -27
- package/dist/utils/index.mjs +0 -1
- package/dist/utils-Bfgoe-Gm.mjs +20 -0
- package/dist/visually-hidden/index.mjs +3 -0
- package/dist/visuallyhidden-aaTUk4Yo.mjs +7 -0
- package/package.json +208 -8
- package/dist/components/index.mjs +0 -8
- package/dist/providers/index.mjs +0 -4
- package/dist/theme-script-DHyLk25i.mjs +0 -11128
- /package/dist/{close.icon-chkXPAUC.mjs → close.icon-CMNMoXM_.mjs} +0 -0
- /package/dist/{map-leaflet-imports-OKaoesjZ.mjs → map-leaflet-imports-CdzvEnzY.mjs} +0 -0
- /package/dist/{theme.provider-DpFLwtHe.mjs → theme.provider-DgGshapa.mjs} +0 -0
- /package/dist/{use-debounce-BYB-jPeX.mjs → use-debounce-DQ1tmxOL.mjs} +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import "../utils-Bfgoe-Gm.mjs";
|
|
2
|
+
import "../button-AzpnV-WB.mjs";
|
|
3
|
+
import "../checkbox-LG1OKTpG.mjs";
|
|
4
|
+
import "../dialog-DXBaT9gA.mjs";
|
|
5
|
+
import "../command-s0Yv3abE.mjs";
|
|
6
|
+
import "../input-DuyjEKEW.mjs";
|
|
7
|
+
import "../textarea-QYRcDEpK.mjs";
|
|
8
|
+
import "../label-_ste_Re3.mjs";
|
|
9
|
+
import "../popover-SQlKSz6L.mjs";
|
|
10
|
+
import "../radio-group-Oshv0b-U.mjs";
|
|
11
|
+
import "../select-DVlEzD2W.mjs";
|
|
12
|
+
import "../switch-Calk7Gyw.mjs";
|
|
13
|
+
import "../tooltip-Dd3ActSS.mjs";
|
|
14
|
+
import { A as FormButton, C as FormField, D as FormCustom, E as FormDescription, O as FormCopyBox, S as FormFieldArray, T as FormDialog, _ as FormSelectItem, a as FormInputGroup, b as FormRadioItem, c as FormStep, d as useWatch, f as useWatchAll, g as FormSelect, h as FormSubmit, i as useField, j as FormAutocomplete, k as FormCheckbox, l as FormStepper, m as FormSwitch, n as useFormContext, o as StepperNavigation, p as FormTextarea, r as useFieldContext, s as StepperControls, t as useStepper, u as FormWhen, v as FormRoot, w as FormError, x as FormInput, y as FormRadioGroup } from "../use-stepper-BaToCYMs.mjs";
|
|
15
|
+
|
|
16
|
+
//#region src/components/features/form/index.ts
|
|
17
|
+
/**
|
|
18
|
+
* Datum Form Library
|
|
19
|
+
*
|
|
20
|
+
* A compound component pattern form library built on top of Conform.js and Zod
|
|
21
|
+
* for easy form creation with built-in validation, error handling, and accessibility features.
|
|
22
|
+
*
|
|
23
|
+
* @example Basic Usage
|
|
24
|
+
* ```tsx
|
|
25
|
+
* import { Form } from './';
|
|
26
|
+
* import { z } from 'zod';
|
|
27
|
+
*
|
|
28
|
+
* const userSchema = z.object({
|
|
29
|
+
* name: z.string().min(2),
|
|
30
|
+
* email: z.string().email(),
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* function UserForm() {
|
|
34
|
+
* return (
|
|
35
|
+
* <Form.Root schema={userSchema} onSubmit={(data) => console.log(data)}>
|
|
36
|
+
* <Form.Field name="name" label="Name" required>
|
|
37
|
+
* <Form.Input />
|
|
38
|
+
* </Form.Field>
|
|
39
|
+
* <Form.Field name="email" label="Email" required>
|
|
40
|
+
* <Form.Input type="email" />
|
|
41
|
+
* </Form.Field>
|
|
42
|
+
* <Form.Submit>Save</Form.Submit>
|
|
43
|
+
* </Form.Root>
|
|
44
|
+
* );
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example Multi-Step Form
|
|
49
|
+
* ```tsx
|
|
50
|
+
* const steps = [
|
|
51
|
+
* { id: 'account', label: 'Account', schema: accountSchema },
|
|
52
|
+
* { id: 'profile', label: 'Profile', schema: profileSchema },
|
|
53
|
+
* ];
|
|
54
|
+
*
|
|
55
|
+
* <Form.Stepper steps={steps} onComplete={handleComplete}>
|
|
56
|
+
* <Form.StepperNavigation />
|
|
57
|
+
* <Form.Step id="account">...</Form.Step>
|
|
58
|
+
* <Form.Step id="profile">...</Form.Step>
|
|
59
|
+
* <Form.StepperControls />
|
|
60
|
+
* </Form.Stepper>
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Conditional Fields
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <Form.Field name="contactMethod">
|
|
66
|
+
* <Form.Select>
|
|
67
|
+
* <Form.SelectItem value="email">Email</Form.SelectItem>
|
|
68
|
+
* <Form.SelectItem value="phone">Phone</Form.SelectItem>
|
|
69
|
+
* </Form.Select>
|
|
70
|
+
* </Form.Field>
|
|
71
|
+
*
|
|
72
|
+
* <Form.When field="contactMethod" is="email">
|
|
73
|
+
* <Form.Field name="email"><Form.Input type="email" /></Form.Field>
|
|
74
|
+
* </Form.When>
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* Form compound component
|
|
79
|
+
*
|
|
80
|
+
* Contains all form-related components as properties:
|
|
81
|
+
* - Form.Root - Main form container
|
|
82
|
+
* - Form.Field - Field wrapper with label and error handling
|
|
83
|
+
* - Form.Input - Text input
|
|
84
|
+
* - Form.Textarea - Multi-line text input
|
|
85
|
+
* - Form.Select - Dropdown select
|
|
86
|
+
* - Form.SelectItem - Select option
|
|
87
|
+
* - Form.Checkbox - Checkbox input
|
|
88
|
+
* - Form.Switch - Toggle switch
|
|
89
|
+
* - Form.RadioGroup - Radio button group
|
|
90
|
+
* - Form.RadioItem - Radio button option
|
|
91
|
+
* - Form.Submit - Submit button with loading state
|
|
92
|
+
* - Form.Error - Error display
|
|
93
|
+
* - Form.Description - Helper text
|
|
94
|
+
* - Form.Autocomplete - Searchable select with virtualization
|
|
95
|
+
* - Form.When - Conditional rendering
|
|
96
|
+
* - Form.FieldArray - Dynamic array of fields
|
|
97
|
+
* - Form.Custom - Escape hatch for custom implementations
|
|
98
|
+
* - Form.Stepper - Multi-step form container
|
|
99
|
+
* - Form.Step - Individual step content
|
|
100
|
+
* - Form.StepperNavigation - Step progress indicators
|
|
101
|
+
* - Form.StepperControls - Previous/Next/Submit buttons
|
|
102
|
+
*
|
|
103
|
+
* Hooks available:
|
|
104
|
+
* - Form.useFormContext - Access form context
|
|
105
|
+
* - Form.useFieldContext - Access field context
|
|
106
|
+
* - Form.useField - Access and control a specific field
|
|
107
|
+
* - Form.useWatch - Watch a field's value
|
|
108
|
+
* - Form.useWatchAll - Watch multiple fields
|
|
109
|
+
* - Form.useStepper - Access stepper context
|
|
110
|
+
*/
|
|
111
|
+
const Form = {
|
|
112
|
+
Root: FormRoot,
|
|
113
|
+
Field: FormField,
|
|
114
|
+
Submit: FormSubmit,
|
|
115
|
+
Button: FormButton,
|
|
116
|
+
Error: FormError,
|
|
117
|
+
Description: FormDescription,
|
|
118
|
+
Input: FormInput,
|
|
119
|
+
Textarea: FormTextarea,
|
|
120
|
+
Select: FormSelect,
|
|
121
|
+
SelectItem: FormSelectItem,
|
|
122
|
+
Checkbox: FormCheckbox,
|
|
123
|
+
Switch: FormSwitch,
|
|
124
|
+
RadioGroup: FormRadioGroup,
|
|
125
|
+
RadioItem: FormRadioItem,
|
|
126
|
+
CopyBox: FormCopyBox,
|
|
127
|
+
Autocomplete: FormAutocomplete,
|
|
128
|
+
InputGroup: FormInputGroup,
|
|
129
|
+
When: FormWhen,
|
|
130
|
+
FieldArray: FormFieldArray,
|
|
131
|
+
Custom: FormCustom,
|
|
132
|
+
Stepper: FormStepper,
|
|
133
|
+
Step: FormStep,
|
|
134
|
+
StepperNavigation,
|
|
135
|
+
StepperControls,
|
|
136
|
+
Dialog: FormDialog,
|
|
137
|
+
useFormContext,
|
|
138
|
+
useFieldContext,
|
|
139
|
+
useField,
|
|
140
|
+
useWatch,
|
|
141
|
+
useWatchAll,
|
|
142
|
+
useStepper
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
export { Form, FormAutocomplete, FormButton, FormCheckbox, FormCopyBox, FormCustom, FormDescription, FormDialog, FormError, FormField, FormFieldArray, FormInput, FormRadioGroup, FormRadioItem, FormRoot, FormSelect, FormSelectItem, FormStep, FormStepper, FormSubmit, FormSwitch, FormTextarea, FormWhen, StepperControls, StepperNavigation, useField, useFieldContext, useFormContext, useStepper, useWatch, useWatchAll };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as getResponsiveValue, c as GRID_COLUMNS, d as RESPONSIVE_MAP, i as getGutter, l as GRID_PREFIX, n as Row, o as registerMediaQuery, r as RowContext, s as GRID_BREAKPOINTS, t as Col, u as RESPONSIVE_ARRAY } from "../col-lrLMZaTJ.mjs";
|
|
2
|
+
|
|
3
|
+
export { Col, GRID_BREAKPOINTS, GRID_COLUMNS, GRID_PREFIX, RESPONSIVE_ARRAY, RESPONSIVE_MAP, Row, RowContext, getGutter, getResponsiveValue, registerMediaQuery };
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as useDebounce } from "../use-debounce-BYB-jPeX.mjs";
|
|
1
|
+
import { t as useCopyToClipboard } from "../use-copy-to-clipboard-ki-WoTml.mjs";
|
|
2
|
+
import { t as useDebounce } from "../use-debounce-DQ1tmxOL.mjs";
|
|
4
3
|
|
|
5
4
|
export { useCopyToClipboard, useDebounce };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as cn } from "./utils-Bfgoe-Gm.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
5
|
+
|
|
6
|
+
//#region ../shadcn/ui/hover-card.tsx
|
|
7
|
+
function HoverCard({ ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(HoverCardPrimitive.Root, {
|
|
9
|
+
"data-slot": "hover-card",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function HoverCardTrigger({ ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(HoverCardPrimitive.Trigger, {
|
|
15
|
+
"data-slot": "hover-card-trigger",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function HoverCardContent({ className, align = "center", sideOffset = 4, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, {
|
|
21
|
+
"data-slot": "hover-card-portal",
|
|
22
|
+
children: /* @__PURE__ */ jsx(HoverCardPrimitive.Content, {
|
|
23
|
+
"data-slot": "hover-card-content",
|
|
24
|
+
align,
|
|
25
|
+
sideOffset,
|
|
26
|
+
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className),
|
|
27
|
+
...props
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { HoverCardContent as n, HoverCardTrigger as r, HoverCard as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/icons/icon-wrapper.tsx
|
|
4
|
+
function Icon({ icon: IconComponent, strokeWidth = 1, absoluteStrokeWidth = true, size = 16, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(IconComponent, {
|
|
6
|
+
...props,
|
|
7
|
+
strokeWidth,
|
|
8
|
+
absoluteStrokeWidth,
|
|
9
|
+
size
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Icon as t };
|
package/dist/icons/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { t as CloseIcon } from "../close.icon-
|
|
1
|
+
import { t as SpinnerIcon } from "../spinner.icon-Bg8zgGh0.mjs";
|
|
2
|
+
import { t as Icon } from "../icon-wrapper-9ticVbRL.mjs";
|
|
3
|
+
import { t as CloseIcon } from "../close.icon-CMNMoXM_.mjs";
|
|
4
4
|
|
|
5
5
|
export { CloseIcon, Icon, SpinnerIcon };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,69 @@
|
|
|
1
|
-
import './style.css';
|
|
2
1
|
import { t as cn } from "./cn-DWCc1QRE.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
2
|
+
import { n as AlertDescription, r as AlertTitle, t as Alert } from "./alert-BC2Mccfo.mjs";
|
|
3
|
+
import { n as badgeVariants, t as Badge } from "./badge-bFgeYceE.mjs";
|
|
4
|
+
import "./utils-Bfgoe-Gm.mjs";
|
|
5
|
+
import { a as BreadcrumbList, i as BreadcrumbLink, n as BreadcrumbEllipsis, o as BreadcrumbPage, r as BreadcrumbItem, s as BreadcrumbSeparator, t as Breadcrumb } from "./breadcrumb-BGYJgom_.mjs";
|
|
6
|
+
import { t as SpinnerIcon } from "./spinner.icon-Bg8zgGh0.mjs";
|
|
7
|
+
import { n as buttonVariants, t as Button } from "./button-C1wRfGtT.mjs";
|
|
8
|
+
import { t as LinkButton } from "./link-button-TIF2Zdrk.mjs";
|
|
9
|
+
import { t as Separator } from "./separator-T2ppyD-8.mjs";
|
|
10
|
+
import { i as buttonGroupVariants, n as ButtonGroupSeparator, r as ButtonGroupText, t as ButtonGroup } from "./button-group-C1IB2K5s.mjs";
|
|
11
|
+
import "./button-AzpnV-WB.mjs";
|
|
12
|
+
import { t as Icon } from "./icon-wrapper-9ticVbRL.mjs";
|
|
13
|
+
import { n as CalendarDayButton, t as Calendar } from "./calendar-DlIHeWb0.mjs";
|
|
14
|
+
import { a as CardDescription, i as CardContent, n as CardFooter, o as CardTitle, r as CardHeader, t as Card } from "./card-3Kd0VdNf.mjs";
|
|
15
|
+
import { a as ChartTooltip, i as ChartStyle, n as ChartLegend, o as ChartTooltipContent, r as ChartLegendContent, t as ChartContainer } from "./chart-BZqUKpkh.mjs";
|
|
16
|
+
import { t as Checkbox } from "./checkbox-LG1OKTpG.mjs";
|
|
17
|
+
import { n as CollapsibleContent, r as CollapsibleTrigger, t as Collapsible } from "./collapsible-Bt9UYfv3.mjs";
|
|
18
|
+
import "./dialog-DXBaT9gA.mjs";
|
|
19
|
+
import { a as CommandInput, c as CommandSeparator, i as CommandGroup, l as CommandShortcut, n as CommandDialog, o as CommandItem, r as CommandEmpty, s as CommandList, t as Command } from "./command-s0Yv3abE.mjs";
|
|
20
|
+
import { t as CloseIcon } from "./close.icon-CMNMoXM_.mjs";
|
|
21
|
+
import { t as Dialog } from "./dialog-bnMMf9GD.mjs";
|
|
22
|
+
import { n as HoverCardContent, r as HoverCardTrigger, t as HoverCard } from "./hover-card-CUPfFUqE.mjs";
|
|
23
|
+
import "./input-DuyjEKEW.mjs";
|
|
24
|
+
import { t as Input } from "./input-fzXBheCN.mjs";
|
|
25
|
+
import "./textarea-QYRcDEpK.mjs";
|
|
26
|
+
import { a as InputGroupText, i as InputGroupInput, n as InputGroupAddon, o as InputGroupTextarea, r as InputGroupButton, t as InputGroup } from "./input-group-CPaFSTEV.mjs";
|
|
27
|
+
import { t as Label } from "./label-_ste_Re3.mjs";
|
|
28
|
+
import { A as useLeaflet, C as MapPolyline, D as MapTileLayer, E as MapSearchControl, O as MapTooltip, S as MapPolygon, T as MapRectangle, _ as MapLayers, a as MapDrawCircle, b as MapMarker, c as MapDrawEdit, d as MapDrawPolyline, f as MapDrawRectangle, g as MapLayerGroup, h as MapFullscreenControl, i as MapControlContainer, j as PlaceAutocomplete, k as MapZoomControl, l as MapDrawMarker, m as MapFeatureGroup, n as MapCircle, o as MapDrawControl, p as MapDrawUndo, r as MapCircleMarker, s as MapDrawDelete, t as Map, u as MapDrawPolygon, v as MapLayersControl, w as MapPopup, x as MapMarkerClusterGroup, y as MapLocateControl } from "./map-Df8QMcX0.mjs";
|
|
29
|
+
import { t as Spinner } from "./spinner-BE7k2bAD.mjs";
|
|
30
|
+
import { i as PopoverTrigger, n as PopoverAnchor, r as PopoverContent, t as Popover } from "./popover-SQlKSz6L.mjs";
|
|
31
|
+
import { n as RadioGroupItem, t as RadioGroup } from "./radio-group-Oshv0b-U.mjs";
|
|
32
|
+
import { a as SelectLabel, c as SelectSeparator, i as SelectItem, l as SelectTrigger, n as SelectContent, o as SelectScrollDownButton, r as SelectGroup, s as SelectScrollUpButton, t as Select, u as SelectValue } from "./select-DVlEzD2W.mjs";
|
|
33
|
+
import { a as SheetHeader, i as SheetFooter, o as SheetTitle, r as SheetDescription, s as SheetTrigger } from "./sheet-CtnP6gTD.mjs";
|
|
34
|
+
import { i as SheetOverlay, n as SheetClose, r as SheetContent, t as Sheet } from "./sheet-BKiCwtNO.mjs";
|
|
35
|
+
import { t as Skeleton } from "./skeleton-vzbxA-DQ.mjs";
|
|
36
|
+
import { t as Switch } from "./switch-Calk7Gyw.mjs";
|
|
37
|
+
import { a as TableFooter, c as TableRow, i as TableCell, n as TableBody, o as TableHead, r as TableCaption, s as TableHeader, t as Table } from "./table-CsXBcQLI.mjs";
|
|
38
|
+
import { a as TabsTrigger, i as TabsList, n as TabsContent, r as TabsLinkTrigger, t as Tabs } from "./tabs-D8n-dqnw.mjs";
|
|
39
|
+
import { t as Textarea } from "./textarea-CxE3YbC7.mjs";
|
|
40
|
+
import { t as Tooltip } from "./tooltip-Dd3ActSS.mjs";
|
|
41
|
+
import { a as ListItem, c as Title, d as titleVariants, i as List, l as paragraphVariants, n as Code, o as Paragraph, r as Link, s as Text, t as Blockquote, u as textVariants } from "./typography-UA7ZZvgJ.mjs";
|
|
42
|
+
import { t as VisuallyHidden } from "./visuallyhidden-aaTUk4Yo.mjs";
|
|
43
|
+
import { t as LoaderOverlay } from "./loader-overlay-DUaQSZQP.mjs";
|
|
44
|
+
import { t as Autocomplete } from "./autocomplete-DZtI97HP.mjs";
|
|
45
|
+
import { n as avatarStackVariants, t as AvatarStack } from "./avatar-stack-JCfBlPB9.mjs";
|
|
46
|
+
import { C as utcToLocalInputString, S as utcStringToZonedDate, T as CalendarDatePicker, _ as getBrowserTimezone, a as formatTimeRangeDisplay, b as getTimezoneOffset, c as getPresetByKey, d as TimezoneSelector, f as QuickRangesPanel, g as formatUtcForDisplay, h as formatTimezoneLabel, i as formatSingleTimeDisplay, l as getPresetByShortcut, m as createTimezoneOption, n as TimeRangePicker, o as DEFAULT_PRESETS, p as CustomRangePanel, r as formatDateForInput, s as getDefaultPreset, t as toApiTimeRange, u as getPresetRange, v as getDefaultTimezoneOptions, w as zonedDateToUtcString, x as localInputStringToUtc, y as getShortTimezoneDisplay } from "./to-api-format-C2xjQUcI.mjs";
|
|
47
|
+
import { a as DropdownMenuItem, c as DropdownMenuRadioGroup, d as DropdownMenuShortcut, f as DropdownMenuSub, h as DropdownMenuTrigger, i as DropdownMenuGroup, l as DropdownMenuRadioItem, m as DropdownMenuSubTrigger, n as DropdownMenuCheckboxItem, o as DropdownMenuLabel, p as DropdownMenuSubContent, r as DropdownMenuContent, s as DropdownMenuPortal, t as DropdownMenu, u as DropdownMenuSeparator } from "./dropdown-DtSa_lqc.mjs";
|
|
48
|
+
import { i as FileInputButton, n as DropzoneContent, r as DropzoneEmptyState, t as Dropzone } from "./dropzone-BkOnwrS4.mjs";
|
|
49
|
+
import { t as EmptyContent } from "./empty-content-BM9rzI13.mjs";
|
|
50
|
+
import { A as FormButton, C as FormField, D as FormCustom, E as FormDescription, O as FormCopyBox, S as FormFieldArray, T as FormDialog, _ as FormSelectItem, b as FormRadioItem, c as FormStep, d as useWatch, f as useWatchAll, g as FormSelect, h as FormSubmit, i as useField, j as FormAutocomplete, k as FormCheckbox, l as FormStepper, m as FormSwitch, n as useFormContext, o as StepperNavigation, p as FormTextarea, r as useFieldContext, s as StepperControls, t as useStepper, u as FormWhen, v as FormRoot, w as FormError, x as FormInput, y as FormRadioGroup } from "./use-stepper-BaToCYMs.mjs";
|
|
51
|
+
import { n as Toaster, r as toast, t as useToast } from "./use-toast-mdn_CqRY.mjs";
|
|
52
|
+
import { t as useCopyToClipboard } from "./use-copy-to-clipboard-ki-WoTml.mjs";
|
|
53
|
+
import { t as defineStepper } from "./stepper-SWB-u_nM.mjs";
|
|
54
|
+
import { t as InputWithAddons } from "./input-with-addons-BQn7KCTU.mjs";
|
|
55
|
+
import { Form } from "./form/index.mjs";
|
|
56
|
+
import { a as getResponsiveValue, c as GRID_COLUMNS, d as RESPONSIVE_MAP, i as getGutter, l as GRID_PREFIX, n as Row, o as registerMediaQuery, r as RowContext, s as GRID_BREAKPOINTS, t as Col, u as RESPONSIVE_ARRAY } from "./col-lrLMZaTJ.mjs";
|
|
57
|
+
import { t as InputNumber } from "./input-number-9o62JHRl.mjs";
|
|
58
|
+
import { t as MoreActions } from "./more-actions-Ch1f6Mh3.mjs";
|
|
59
|
+
import { configureProgress, startProgress, stopProgress } from "./nprogress/index.mjs";
|
|
60
|
+
import { t as PageTitle } from "./page-title-BJuo81rT.mjs";
|
|
61
|
+
import { C as SidebarTrigger, E as NavMain, S as SidebarSeparator, T as AppSidebar, _ as SidebarMenuSub, a as SidebarGroupAction, b as SidebarProvider, c as SidebarHeader, d as SidebarMenu, f as SidebarMenuAction, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, l as SidebarInput, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, p as SidebarMenuBadge, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, u as SidebarInset, v as SidebarMenuSubButton, w as useSidebar, x as SidebarRail, y as SidebarMenuSubItem } from "./sidebar-DfqezV8t.mjs";
|
|
62
|
+
import { t as TagsInput } from "./tag-input-Di7SDNbK.mjs";
|
|
63
|
+
import { _ as RedisTaskStorage, a as TaskPanelItem, b as createProjectMetadata, c as TaskPanelHeader, d as useCurrentScope, f as useTasksWithLabels, g as detectStorage, h as TaskQueue, i as TaskPanel, l as getContextLabel, m as TaskQueueProvider, n as TaskSummaryDialog, o as TaskPanelCounter, p as useTaskQueue, r as TaskQueueTrigger, s as TaskPanelActions, t as TaskQueueDropdown, u as matchesCurrentScope, v as LocalTaskStorage, x as createUserMetadata, y as createOrgMetadata } from "./task-queue-dropdown-DW72ikDH.mjs";
|
|
64
|
+
import { n as ClientOnly, t as ThemeScript } from "./theme-script-XBouzsNR.mjs";
|
|
65
|
+
import { n as useTheme, t as ThemeProvider } from "./theme.provider-DgGshapa.mjs";
|
|
66
|
+
import { t as useDebounce } from "./use-debounce-DQ1tmxOL.mjs";
|
|
67
|
+
import { t as DatumProvider } from "./datum.provider-B77goJgl.mjs";
|
|
10
68
|
|
|
11
69
|
export { CustomRangePanel as AbsoluteRangePanel, CustomRangePanel, Alert, AlertDescription, AlertTitle, AppSidebar, Autocomplete, AvatarStack, Badge, Blockquote, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDatePicker, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, ClientOnly, CloseIcon, Code, Col, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_PRESETS, DatumProvider, Dialog, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, DropzoneEmptyState, EmptyContent, FileInputButton, Form, FormAutocomplete, FormButton, FormCheckbox, FormCopyBox, FormCustom, FormDescription, FormDialog, FormError, FormField, FormFieldArray, FormInput, FormRadioGroup, FormRadioItem, FormRoot, FormSelect, FormSelectItem, FormStep, FormStepper, FormSubmit, FormSwitch, FormTextarea, FormWhen, GRID_BREAKPOINTS, GRID_COLUMNS, GRID_PREFIX, HoverCard, HoverCardContent, HoverCardTrigger, Icon, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputNumber, InputWithAddons, Label, Link, LinkButton, List, ListItem, LoaderOverlay, LocalTaskStorage, Map, MapCircle, MapCircleMarker, MapControlContainer, MapDrawCircle, MapDrawControl, MapDrawDelete, MapDrawEdit, MapDrawMarker, MapDrawPolygon, MapDrawPolyline, MapDrawRectangle, MapDrawUndo, MapFeatureGroup, MapFullscreenControl, MapLayerGroup, MapLayers, MapLayersControl, MapLocateControl, MapMarker, MapMarkerClusterGroup, MapPolygon, MapPolyline, MapPopup, MapRectangle, MapSearchControl, MapTileLayer, MapTooltip, MapZoomControl, MoreActions, NavMain, PageTitle, Paragraph, PlaceAutocomplete, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, QuickRangesPanel, RESPONSIVE_ARRAY, RESPONSIVE_MAP, RadioGroup, RadioGroupItem, RedisTaskStorage, Row, RowContext, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, SpinnerIcon, StepperControls, StepperNavigation, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsLinkTrigger, TabsList, TabsTrigger, TagsInput, TaskPanel, TaskPanelActions, TaskPanelCounter, TaskPanelHeader, TaskPanelItem, TaskQueue, TaskQueueDropdown, TaskQueueProvider, TaskQueueTrigger, TaskSummaryDialog, Text, Textarea, ThemeProvider, ThemeScript, TimeRangePicker, TimezoneSelector, Title, Toaster, Tooltip, VisuallyHidden, avatarStackVariants, badgeVariants, buttonGroupVariants, buttonVariants, cn, configureProgress, createOrgMetadata, createProjectMetadata, createTimezoneOption, createUserMetadata, defineStepper, detectStorage, formatDateForInput, formatSingleTimeDisplay, formatTimeRangeDisplay, formatTimezoneLabel, formatUtcForDisplay, getBrowserTimezone, getContextLabel, getDefaultPreset, getDefaultTimezoneOptions, getGutter, getPresetByKey, getPresetByShortcut, getPresetRange, getResponsiveValue, getShortTimezoneDisplay, getTimezoneOffset, localInputStringToUtc, matchesCurrentScope, paragraphVariants, registerMediaQuery, startProgress, stopProgress, textVariants, titleVariants, toApiTimeRange, toast, useCopyToClipboard, useCurrentScope, useDebounce, useField, useFieldContext, useFormContext, useLeaflet, useSidebar, useStepper, useTaskQueue, useTasksWithLabels, useTheme, useToast, useWatch, useWatchAll, utcStringToZonedDate, utcToLocalInputString, zonedDateToUtcString };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as cn } from "./utils-Bfgoe-Gm.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region ../shadcn/ui/input.tsx
|
|
6
|
+
const Input = ({ className, type, ...props }) => {
|
|
7
|
+
return /* @__PURE__ */ jsx("input", {
|
|
8
|
+
type,
|
|
9
|
+
className: cn("flex h-10 w-full rounded-md px-3 py-2 text-base md:text-sm", "border-input bg-background ring-offset-background border", "placeholder:text-muted-foreground focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden", "read-only:cursor-not-allowed read-only:opacity-50 disabled:cursor-not-allowed disabled:opacity-50", "file:text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium", className),
|
|
10
|
+
"data-slot": "input",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
Input.displayName = "Input";
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Input as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as cn } from "./cn-DWCc1QRE.mjs";
|
|
2
|
+
import { t as Input$1 } from "./input-DuyjEKEW.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/base/input/input.tsx
|
|
7
|
+
function Input({ ref, className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Input$1, {
|
|
9
|
+
ref,
|
|
10
|
+
className: cn("rounded-lg", "bg-input-background/50", "text-input-foreground", "border-input-border", "placeholder:text-input-placeholder", "focus-visible:ring-0 focus-visible:ring-offset-0", "focus-visible:border-input-focus-border", "focus-visible:shadow-(--input-focus-shadow)", "aria-invalid:border-destructive", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
Input.displayName = "Input";
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Input as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "../utils-Bfgoe-Gm.mjs";
|
|
2
|
+
import "../button-AzpnV-WB.mjs";
|
|
3
|
+
import "../input-DuyjEKEW.mjs";
|
|
4
|
+
import "../textarea-QYRcDEpK.mjs";
|
|
5
|
+
import { a as InputGroupText, i as InputGroupInput, n as InputGroupAddon, o as InputGroupTextarea, r as InputGroupButton, t as InputGroup } from "../input-group-CPaFSTEV.mjs";
|
|
6
|
+
|
|
7
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { t as cn } from "./utils-Bfgoe-Gm.mjs";
|
|
2
|
+
import { t as Button } from "./button-AzpnV-WB.mjs";
|
|
3
|
+
import { t as Input } from "./input-DuyjEKEW.mjs";
|
|
4
|
+
import { t as Textarea } from "./textarea-QYRcDEpK.mjs";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region ../shadcn/ui/input-group.tsx
|
|
10
|
+
function InputGroup({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", {
|
|
12
|
+
"data-slot": "input-group",
|
|
13
|
+
role: "group",
|
|
14
|
+
className: cn("group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none", "h-9 has-[>textarea]:h-auto", "has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3", "has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]:focus-visible]:ring-1", "has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", className),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const inputGroupAddonVariants = cva("text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
19
|
+
variants: { align: {
|
|
20
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
21
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]",
|
|
22
|
+
"block-start": "[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5",
|
|
23
|
+
"block-end": "[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5"
|
|
24
|
+
} },
|
|
25
|
+
defaultVariants: { align: "inline-start" }
|
|
26
|
+
});
|
|
27
|
+
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
role: "group",
|
|
30
|
+
"data-slot": "input-group-addon",
|
|
31
|
+
"data-align": align,
|
|
32
|
+
className: cn(inputGroupAddonVariants({ align }), className),
|
|
33
|
+
onClick: (e) => {
|
|
34
|
+
if (e.target.closest("button")) return;
|
|
35
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
36
|
+
},
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
|
|
41
|
+
variants: { size: {
|
|
42
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
|
43
|
+
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
|
44
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
45
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
46
|
+
} },
|
|
47
|
+
defaultVariants: { size: "xs" }
|
|
48
|
+
});
|
|
49
|
+
function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
51
|
+
type,
|
|
52
|
+
"data-size": size,
|
|
53
|
+
variant,
|
|
54
|
+
className: cn(inputGroupButtonVariants({ size }), className),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function InputGroupText({ className, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsx("span", {
|
|
60
|
+
className: cn("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function InputGroupInput({ className, ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
66
|
+
"data-slot": "input-group-control",
|
|
67
|
+
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx(Textarea, {
|
|
73
|
+
"data-slot": "input-group-control",
|
|
74
|
+
className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
export { InputGroupText as a, InputGroupInput as i, InputGroupAddon as n, InputGroupTextarea as o, InputGroupButton as r, InputGroup as t };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { t as Button } from "./button-AzpnV-WB.mjs";
|
|
2
|
+
import { t as Icon } from "./icon-wrapper-9ticVbRL.mjs";
|
|
3
|
+
import { t as Input } from "./input-fzXBheCN.mjs";
|
|
4
|
+
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { NumericFormat } from "react-number-format";
|
|
8
|
+
|
|
9
|
+
//#region src/components/features/input-number/input-number.tsx
|
|
10
|
+
function InputNumber({ ref, stepper, thousandSeparator, placeholder, defaultValue, min = -Infinity, max = Infinity, onValueChange, fixedDecimalScale = false, decimalScale = 0, suffix, prefix, value: controlledValue, ...props }) {
|
|
11
|
+
const internalRef = useRef(null);
|
|
12
|
+
const combinedRef = ref || internalRef;
|
|
13
|
+
const [value, setValue] = useState(controlledValue ?? defaultValue);
|
|
14
|
+
const handleIncrement = useCallback(() => {
|
|
15
|
+
setValue((prev) => prev === void 0 ? stepper ?? 1 : Math.min(prev + (stepper ?? 1), max));
|
|
16
|
+
}, [stepper, max]);
|
|
17
|
+
const handleDecrement = useCallback(() => {
|
|
18
|
+
setValue((prev) => prev === void 0 ? -(stepper ?? 1) : Math.max(prev - (stepper ?? 1), min));
|
|
19
|
+
}, [stepper, min]);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const handleKeyDown = (e) => {
|
|
22
|
+
if (document.activeElement === combinedRef.current) {
|
|
23
|
+
if (e.key === "ArrowUp") handleIncrement();
|
|
24
|
+
else if (e.key === "ArrowDown") handleDecrement();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
28
|
+
return () => {
|
|
29
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
30
|
+
};
|
|
31
|
+
}, [
|
|
32
|
+
handleIncrement,
|
|
33
|
+
handleDecrement,
|
|
34
|
+
combinedRef
|
|
35
|
+
]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (controlledValue !== void 0) setValue(controlledValue);
|
|
38
|
+
}, [controlledValue]);
|
|
39
|
+
const handleChange = (values) => {
|
|
40
|
+
const newValue = values.floatValue === void 0 ? void 0 : values.floatValue;
|
|
41
|
+
setValue(newValue);
|
|
42
|
+
if (onValueChange) onValueChange(newValue);
|
|
43
|
+
};
|
|
44
|
+
const handleBlur = () => {
|
|
45
|
+
if (value !== void 0) {
|
|
46
|
+
if (value < min) {
|
|
47
|
+
setValue(min);
|
|
48
|
+
ref.current.value = String(min);
|
|
49
|
+
} else if (value > max) {
|
|
50
|
+
setValue(max);
|
|
51
|
+
ref.current.value = String(max);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
56
|
+
className: "flex items-center",
|
|
57
|
+
children: [/* @__PURE__ */ jsx(NumericFormat, {
|
|
58
|
+
value,
|
|
59
|
+
onValueChange: handleChange,
|
|
60
|
+
thousandSeparator,
|
|
61
|
+
decimalScale,
|
|
62
|
+
fixedDecimalScale,
|
|
63
|
+
allowNegative: min < 0,
|
|
64
|
+
valueIsNumericString: true,
|
|
65
|
+
onBlur: handleBlur,
|
|
66
|
+
max,
|
|
67
|
+
min,
|
|
68
|
+
suffix,
|
|
69
|
+
prefix,
|
|
70
|
+
customInput: Input,
|
|
71
|
+
placeholder,
|
|
72
|
+
className: "relative [appearance:textfield] rounded-r-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
73
|
+
getInputRef: combinedRef,
|
|
74
|
+
...props
|
|
75
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
76
|
+
className: "flex flex-col",
|
|
77
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
78
|
+
type: "button",
|
|
79
|
+
"aria-label": "Increase value",
|
|
80
|
+
className: "border-input h-5 rounded-l-none rounded-br-none border-b-[0.5px] border-l-0 px-2 focus-visible:relative",
|
|
81
|
+
variant: "outline",
|
|
82
|
+
onClick: handleIncrement,
|
|
83
|
+
disabled: value === max,
|
|
84
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
85
|
+
icon: ChevronUp,
|
|
86
|
+
size: 15
|
|
87
|
+
})
|
|
88
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
89
|
+
type: "button",
|
|
90
|
+
"aria-label": "Decrease value",
|
|
91
|
+
className: "border-input h-5 rounded-l-none rounded-tr-none border-t-[0.5px] border-l-0 px-2 focus-visible:relative",
|
|
92
|
+
variant: "outline",
|
|
93
|
+
onClick: handleDecrement,
|
|
94
|
+
disabled: value === min,
|
|
95
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
96
|
+
icon: ChevronDown,
|
|
97
|
+
size: 15
|
|
98
|
+
})
|
|
99
|
+
})]
|
|
100
|
+
})]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
InputNumber.displayName = "InputNumber";
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
export { InputNumber as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { t as cn } from "./cn-DWCc1QRE.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/features/input-with-addons/input-with-addons.tsx
|
|
6
|
+
function InputWithAddons({ ref, leading, trailing, containerClassName, className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8
|
+
className: cn("border-input-border bg-input-background/50 text-input-foreground placeholder:text-input-placeholder", "focus-within:border-input-focus-border focus-within:shadow-(--input-focus-shadow)", "group flex h-10 w-full items-stretch overflow-hidden rounded-lg border transition-all", "focus-within:ring-0 focus-within:ring-offset-0 focus-within:outline-hidden", containerClassName),
|
|
9
|
+
children: [
|
|
10
|
+
leading ? /* @__PURE__ */ jsx("div", {
|
|
11
|
+
className: "text-muted-foreground flex items-center bg-transparent pl-3",
|
|
12
|
+
children: leading
|
|
13
|
+
}) : null,
|
|
14
|
+
/* @__PURE__ */ jsx("input", {
|
|
15
|
+
className: cn("flex-1 bg-transparent px-3 text-base md:text-sm", "placeholder:text-input-placeholder text-input-foreground", "focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-hidden", "focus-visible:border-transparent focus-visible:shadow-none", "read-only:cursor-not-allowed read-only:opacity-50 disabled:cursor-not-allowed disabled:opacity-50", "file:text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium", leading && "pl-2", trailing && "pr-2", className),
|
|
16
|
+
"data-slot": "input-with-addons",
|
|
17
|
+
ref,
|
|
18
|
+
...props
|
|
19
|
+
}),
|
|
20
|
+
trailing ? /* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: "text-muted-foreground flex items-center bg-transparent pr-3",
|
|
22
|
+
children: trailing
|
|
23
|
+
}) : null
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
InputWithAddons.displayName = "InputWithAddons";
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { InputWithAddons as t };
|