@sth87/shadcn-design-system 0.0.9 → 0.0.10
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/dist/cjs/components/Textarea/Textarea.cjs +1 -1
- package/dist/cjs/components/Textarea/Textarea.cjs.map +1 -1
- package/dist/esm/components/Textarea/Textarea.js +120 -118
- package/dist/esm/components/Textarea/Textarea.js.map +1 -1
- package/dist/types/components/Accordion/Accordion.d.ts +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts +1 -1
- package/dist/types/components/Badge/Badge.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Button/ButtonGroup.d.ts +1 -1
- package/dist/types/components/Calendar/Calendar.d.ts +1 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/components/Collapsible/Collapsible.d.ts +1 -1
- package/dist/types/components/Command/index.d.ts +1 -1
- package/dist/types/components/ContextMenu/index.d.ts +1 -1
- package/dist/types/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/types/components/DatePicker/RangePicker.d.ts +1 -1
- package/dist/types/components/DropdownMenu/index.d.ts +1 -1
- package/dist/types/components/InputOTP/InputOTP.d.ts +1 -1
- package/dist/types/components/Label/Label.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +1 -1
- package/dist/types/components/Radio/Radio.d.ts +1 -1
- package/dist/types/components/Resizable/Resizable.d.ts +1 -1
- package/dist/types/components/ScrollArea/ScrollArea.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/Separator/Separator.d.ts +1 -1
- package/dist/types/components/Sheet/Sheet.d.ts +2 -2
- package/dist/types/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/components/Sidebar/index.d.ts +1 -1
- package/dist/types/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/types/components/Switch/Switch.d.ts +1 -1
- package/dist/types/components/Textarea/Textarea.d.ts +1 -1
- package/dist/types/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/types/components/Toggle/Toggle.d.ts +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/types/components/TreeSelect/TreeSelect.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/lib/utils.d.ts +1 -1
- package/dist/types/packages/ui/src/card.d.ts +8 -0
- package/dist/types/packages/ui/src/card.d.ts.map +1 -0
- package/dist/types/packages/ui/src/code.d.ts +6 -0
- package/dist/types/packages/ui/src/code.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/accordion.d.ts +8 -0
- package/dist/types/packages/ui/src/components/accordion.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/alert-dialog.d.ts +22 -0
- package/dist/types/packages/ui/src/components/alert-dialog.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/avatar.d.ts +10 -0
- package/dist/types/packages/ui/src/components/avatar.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/badge.d.ts +14 -0
- package/dist/types/packages/ui/src/components/badge.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/breadcrumb.d.ts +12 -0
- package/dist/types/packages/ui/src/components/breadcrumb.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/button-group.d.ts +12 -0
- package/dist/types/packages/ui/src/components/button-group.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/button.d.ts +13 -0
- package/dist/types/packages/ui/src/components/button.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/calendar.d.ts +17 -0
- package/dist/types/packages/ui/src/components/calendar.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/checkbox.d.ts +13 -0
- package/dist/types/packages/ui/src/components/checkbox.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/collapsible.d.ts +6 -0
- package/dist/types/packages/ui/src/components/collapsible.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/combobox.d.ts +34 -0
- package/dist/types/packages/ui/src/components/combobox.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/command.d.ts +19 -0
- package/dist/types/packages/ui/src/components/command.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/context-menu.d.ts +26 -0
- package/dist/types/packages/ui/src/components/context-menu.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/dialog.d.ts +22 -0
- package/dist/types/packages/ui/src/components/dialog.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/drawer.d.ts +14 -0
- package/dist/types/packages/ui/src/components/drawer.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/dropdown-menu.d.ts +26 -0
- package/dist/types/packages/ui/src/components/dropdown-menu.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/input-otp.d.ts +20 -0
- package/dist/types/packages/ui/src/components/input-otp.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/input.d.ts +13 -0
- package/dist/types/packages/ui/src/components/input.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/label.d.ts +5 -0
- package/dist/types/packages/ui/src/components/label.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/pagination.d.ts +20 -0
- package/dist/types/packages/ui/src/components/pagination.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/popover.d.ts +15 -0
- package/dist/types/packages/ui/src/components/popover.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/radio-group.d.ts +17 -0
- package/dist/types/packages/ui/src/components/radio-group.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/resizable.d.ts +14 -0
- package/dist/types/packages/ui/src/components/resizable.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/scroll-area.d.ts +6 -0
- package/dist/types/packages/ui/src/components/scroll-area.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/select.d.ts +43 -0
- package/dist/types/packages/ui/src/components/select.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/separator.d.ts +20 -0
- package/dist/types/packages/ui/src/components/separator.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/sheet.d.ts +15 -0
- package/dist/types/packages/ui/src/components/sheet.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/sidebar.d.ts +70 -0
- package/dist/types/packages/ui/src/components/sidebar.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/skeleton.d.ts +3 -0
- package/dist/types/packages/ui/src/components/skeleton.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/slider.d.ts +5 -0
- package/dist/types/packages/ui/src/components/slider.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/switch.d.ts +14 -0
- package/dist/types/packages/ui/src/components/switch.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/table.d.ts +11 -0
- package/dist/types/packages/ui/src/components/table.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/tabs.d.ts +8 -0
- package/dist/types/packages/ui/src/components/tabs.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/textarea.d.ts +13 -0
- package/dist/types/packages/ui/src/components/textarea.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/toggle.d.ts +11 -0
- package/dist/types/packages/ui/src/components/toggle.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/tooltip.d.ts +18 -0
- package/dist/types/packages/ui/src/components/tooltip.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/tree-view.d.ts +30 -0
- package/dist/types/packages/ui/src/components/tree-view.d.ts.map +1 -0
- package/dist/types/packages/ui/src/constants/color.d.ts +19 -0
- package/dist/types/packages/ui/src/constants/color.d.ts.map +1 -0
- package/dist/types/packages/ui/src/hooks/use-mobile.d.ts +2 -0
- package/dist/types/packages/ui/src/hooks/use-mobile.d.ts.map +1 -0
- package/dist/types/packages/ui/src/index.d.ts +39 -0
- package/dist/types/packages/ui/src/index.d.ts.map +1 -0
- package/dist/types/packages/ui/src/lib/compose-refs.d.ts +17 -0
- package/dist/types/packages/ui/src/lib/compose-refs.d.ts.map +1 -0
- package/dist/types/packages/ui/src/lib/utils.d.ts +3 -0
- package/dist/types/packages/ui/src/lib/utils.d.ts.map +1 -0
- package/dist/types/tsconfig.json +13 -0
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),l=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),l=require("react"),C=require("../../packages/ui/src/components/textarea.cjs"),u=require("../../packages/ui/src/lib/utils.cjs"),b=require("lucide-react"),T=require("../Tooltip/Tooltip.cjs"),E=require("../FloatLabel.cjs"),M=require("../../packages/ui/src/components/label.cjs"),j=l.forwardRef(({className:N,label:d,helperText:i,state:o,size:t="normal",isFloatLabel:r,maxLength:a,showCharCount:g,infoTooltip:x,clearable:h,onClear:p,placeholder:y=" ",onChange:q,...n},w)=>{const[f,v]=l.useState(()=>typeof n.value=="string"?n.value.length:typeof n.defaultValue=="string"?n.defaultValue.length:0),I=c=>{v(c.target.value.length),q?.(c)},m=l.useId(),s=l.useRef(null);l.useImperativeHandle(w,()=>s.current);const R=()=>{if(s.current){s.current.value="",v(0);const c=new Event("input",{bubbles:!0});s.current.dispatchEvent(c),p&&p()}},S={default:"text-muted-foreground",success:"text-success",warning:"text-warning",error:"text-error"};return e.jsx("div",{className:N,children:e.jsxs("div",{className:u.cn("flex flex-col gap-1.5 relative",{"floating-label":r}),children:[!r&&d&&e.jsxs(M.Label,{htmlFor:m,className:"flex gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:[d,x&&e.jsx(T.Tooltip,{content:x,children:e.jsx(b.Info,{className:"size-3.5 min-w-3.5"})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(C.Textarea,{ref:s,id:m,className:u.cn("peer resize-y",{"pt-6 pb-2":r&&(t==="lg"||t==="xl"),"pt-6 pb-1":r&&t!=="lg"&&t!=="xl","text-lg":(t==="xl"||t==="lg")&&!r},h&&f>0&&"pr-10"),placeholder:y,maxLength:a,onChange:I,state:o,size:r?t==="xl"||t==="lg"?t:"xl":t,...n}),r&&e.jsx(E.FloatingLabel,{htmlFor:m,size:t,infoTooltip:x,className:"peer-placeholder-shown:items-start",children:d}),h&&f>0&&e.jsx("button",{type:"button",tabIndex:-1,className:u.cn("absolute top-2 right-2 p-1 rounded hover:bg-accent transition-colors"),onClick:R,disabled:n.disabled,children:e.jsx(b.X,{className:"size-4"})})]}),(i||g&&typeof a=="number")&&e.jsxs("div",{className:"flex items-center justify-between text-xs gap-2",children:[i&&e.jsx("p",{className:u.cn("text-xs",o?S?.[o]:""),children:i}),g&&typeof a=="number"&&e.jsxs("span",{className:"ml-auto text-muted-foreground",children:[f," / ",a]})]})]})})});j.displayName="Textarea";exports.default=j;
|
|
2
2
|
//# sourceMappingURL=Textarea.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.cjs","sources":["../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n Textarea as STextarea,\n type TextareaProps as STextareaProps,\n} from \"@dsui/ui/components/textarea\";\nimport { cn } from \"@dsui/ui/lib/utils\";\nimport { Info, X } from \"lucide-react\";\nimport { Tooltip } from \"../Tooltip/Tooltip\";\nimport { FloatingLabel } from \"@/components/FloatLabel\";\nimport { Label } from \"../Label\";\n\nexport type TextareaProps = Omit<\n STextareaProps,\n \"onChange\" | \"size\" | \"state\"\n> & {\n onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n size?: \"xs\" | \"sm\" | \"normal\" | \"lg\" | \"xl\";\n state?: \"default\" | \"success\" | \"warning\" | \"error\";\n label?: string;\n helperText?: React.ReactNode;\n isFloatLabel?: boolean;\n maxLength?: number;\n showCharCount?: boolean;\n infoTooltip?: React.ReactNode;\n clearable?: boolean;\n onClear?: () => void;\n};\n\nconst
|
|
1
|
+
{"version":3,"file":"Textarea.cjs","sources":["../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n Textarea as STextarea,\n type TextareaProps as STextareaProps,\n} from \"@dsui/ui/components/textarea\";\nimport { cn } from \"@dsui/ui/lib/utils\";\nimport { Info, X } from \"lucide-react\";\nimport { Tooltip } from \"../Tooltip/Tooltip\";\nimport { FloatingLabel } from \"@/components/FloatLabel\";\nimport { Label } from \"../Label\";\n\nexport type TextareaProps = Omit<\n STextareaProps,\n \"onChange\" | \"size\" | \"state\"\n> & {\n onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n size?: \"xs\" | \"sm\" | \"normal\" | \"lg\" | \"xl\";\n state?: \"default\" | \"success\" | \"warning\" | \"error\";\n label?: string;\n helperText?: React.ReactNode;\n isFloatLabel?: boolean;\n maxLength?: number;\n showCharCount?: boolean;\n infoTooltip?: React.ReactNode;\n clearable?: boolean;\n onClear?: () => void;\n};\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n className,\n label,\n helperText,\n state,\n size = \"normal\",\n isFloatLabel,\n maxLength,\n showCharCount,\n infoTooltip,\n clearable,\n onClear,\n placeholder = \" \",\n onChange,\n ...props\n },\n ref\n ) => {\n // Character count state\n const [charCount, setCharCount] = React.useState(() => {\n if (typeof props.value === \"string\") return props.value.length;\n if (typeof props.defaultValue === \"string\")\n return props.defaultValue.length;\n return 0;\n });\n\n const handleInput = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setCharCount(e.target.value.length);\n onChange?.(e);\n };\n\n const textareaId = React.useId();\n const innerRef = React.useRef<HTMLTextAreaElement>(null);\n\n // Combine refs\n React.useImperativeHandle(ref, () => innerRef.current!);\n\n const handleClear = () => {\n if (innerRef.current) {\n innerRef.current.value = \"\";\n setCharCount(0);\n const event = new Event(\"input\", { bubbles: true });\n innerRef.current.dispatchEvent(event);\n if (onClear) onClear();\n }\n };\n\n // State\n const helperTextStyles = {\n default: \"text-muted-foreground\",\n success: \"text-success\",\n warning: \"text-warning\",\n error: \"text-error\",\n };\n\n return (\n <div className={className}>\n <div\n className={cn(\"flex flex-col gap-1.5 relative\", {\n \"floating-label\": isFloatLabel,\n })}\n >\n {!isFloatLabel && label && (\n <Label\n htmlFor={textareaId}\n className=\"flex gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {infoTooltip && (\n <Tooltip content={infoTooltip}>\n <Info className=\"size-3.5 min-w-3.5\" />\n </Tooltip>\n )}\n </Label>\n )}\n\n <div className=\"relative\">\n <STextarea\n ref={innerRef}\n id={textareaId}\n className={cn(\n \"peer resize-y\",\n {\n \"pt-6 pb-2\": isFloatLabel && (size === \"lg\" || size === \"xl\"),\n \"pt-6 pb-1\": isFloatLabel && size !== \"lg\" && size !== \"xl\",\n \"text-lg\": (size === \"xl\" || size === \"lg\") && !isFloatLabel,\n },\n clearable && charCount > 0 && \"pr-10\"\n // className\n )}\n placeholder={placeholder}\n maxLength={maxLength}\n onChange={handleInput}\n state={state}\n size={\n isFloatLabel\n ? size === \"xl\" || size === \"lg\"\n ? size\n : \"xl\"\n : size\n }\n {...props}\n />\n {isFloatLabel && (\n <FloatingLabel\n htmlFor={textareaId}\n size={size}\n infoTooltip={infoTooltip}\n className=\"peer-placeholder-shown:items-start\"\n >\n {label}\n </FloatingLabel>\n )}\n\n {/* Clear Button */}\n {clearable && charCount > 0 && (\n <button\n type=\"button\"\n tabIndex={-1}\n className={cn(\n \"absolute top-2 right-2 p-1 rounded hover:bg-accent transition-colors\"\n )}\n onClick={handleClear}\n disabled={props.disabled}\n >\n <X className=\"size-4\" />\n </button>\n )}\n </div>\n\n {(helperText || (showCharCount && typeof maxLength === \"number\")) && (\n <div className=\"flex items-center justify-between text-xs gap-2\">\n {helperText && (\n <p\n className={cn(\n \"text-xs\",\n state ? helperTextStyles?.[state] : \"\"\n )}\n >\n {helperText}\n </p>\n )}\n {showCharCount && typeof maxLength === \"number\" && (\n <span className=\"ml-auto text-muted-foreground\">\n {charCount} / {maxLength}\n </span>\n )}\n </div>\n )}\n </div>\n </div>\n );\n }\n);\n\nTextarea.displayName = \"Textarea\";\nexport default Textarea;\n"],"names":["Textarea","React","className","label","helperText","state","size","isFloatLabel","maxLength","showCharCount","infoTooltip","clearable","onClear","placeholder","onChange","props","ref","charCount","setCharCount","handleInput","e","textareaId","innerRef","handleClear","event","helperTextStyles","jsx","jsxs","cn","Label","Tooltip","Info","STextarea","FloatingLabel","X"],"mappings":"qaA4BMA,EAAWC,EAAM,WACrB,CACE,CACE,UAAAC,EAAA,MACAC,EACA,WAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,SACP,aAAAC,EACA,UAAAC,EACA,cAAAC,EACA,YAAAC,EACA,UAAAC,EACA,QAAAC,EACA,YAAAC,EAAc,IACd,SAAAC,EACA,GAAGC,CAAA,EAELC,IACG,CAEH,KAAM,CAACC,EAAWC,CAAY,EAAIjB,EAAM,SAAS,IAC3C,OAAOc,EAAM,OAAU,SAAiBA,EAAM,MAAM,OACpD,OAAOA,EAAM,cAAiB,SACzBA,EAAM,aAAa,OACrB,CACR,EAEKI,EAAeC,GAA8C,CACjEF,EAAaE,EAAE,OAAO,MAAM,MAAM,EAClCN,IAAWM,CAAC,CACd,EAEMC,EAAapB,EAAM,MAAA,EACnBqB,EAAWrB,EAAM,OAA4B,IAAI,EAGvDA,EAAM,oBAAoBe,EAAK,IAAMM,EAAS,OAAQ,EAEtD,MAAMC,EAAc,IAAM,CACxB,GAAID,EAAS,QAAS,CACpBA,EAAS,QAAQ,MAAQ,GACzBJ,EAAa,CAAC,EACd,MAAMM,EAAQ,IAAI,MAAM,QAAS,CAAE,QAAS,GAAM,EAClDF,EAAS,QAAQ,cAAcE,CAAK,EAChCZ,GAASA,EAAA,CACf,CACF,EAGMa,EAAmB,CACvB,QAAS,wBACT,QAAS,eACT,QAAS,eACT,MAAO,YAAA,EAGT,OACEC,EAAAA,IAAC,OAAI,UAAAxB,EACH,SAAAyB,EAAAA,KAAC,MAAA,CACC,UAAWC,EAAAA,GAA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,EAGrC,SAAAD,CAAA,CAAA,EAGJK,GAAiB,OAAOD,GAAc,UACrCmB,EAAAA,KAAC,OAAA,CAAK,UAAU,gCACb,SAAA,CAAAV,EAAU,MAAIT,CAAA,CAAA,CACjB,CAAA,CAAA,CAEJ,CAAA,CAAA,CAAA,EAGN,CAEJ,CACF,EAEAR,EAAS,YAAc"}
|
|
@@ -1,132 +1,134 @@
|
|
|
1
1
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import c from "react";
|
|
3
|
-
import { Textarea as
|
|
3
|
+
import { Textarea as E } from "../../packages/ui/src/components/textarea.js";
|
|
4
4
|
import { cn as d } from "../../packages/ui/src/lib/utils.js";
|
|
5
|
-
import { Info as
|
|
5
|
+
import { Info as S, X as T } from "lucide-react";
|
|
6
6
|
import { Tooltip as V } from "../Tooltip/Tooltip.js";
|
|
7
7
|
import { FloatingLabel as _ } from "../FloatLabel.js";
|
|
8
8
|
import { Label as k } from "../../packages/ui/src/components/label.js";
|
|
9
|
-
const H = (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
N(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
a.current
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"div",
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
htmlFor: x,
|
|
52
|
-
className: "flex gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
53
|
-
children: [
|
|
54
|
-
u,
|
|
55
|
-
f && /* @__PURE__ */ t(V, { content: f, children: /* @__PURE__ */ t(E, { className: "size-3.5 min-w-3.5" }) })
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
/* @__PURE__ */ l("div", { className: "relative", children: [
|
|
60
|
-
/* @__PURE__ */ t(
|
|
61
|
-
T,
|
|
62
|
-
{
|
|
63
|
-
ref: a,
|
|
64
|
-
id: x,
|
|
65
|
-
className: d(
|
|
66
|
-
"peer resize-y",
|
|
67
|
-
{
|
|
68
|
-
"pt-6 pb-2": r && (e === "lg" || e === "xl"),
|
|
69
|
-
"pt-6 pb-1": r && e !== "lg" && e !== "xl",
|
|
70
|
-
"text-lg": (e === "xl" || e === "lg") && !r
|
|
71
|
-
},
|
|
72
|
-
h && p > 0 && "pr-10"
|
|
73
|
-
// className
|
|
74
|
-
),
|
|
75
|
-
placeholder: y,
|
|
76
|
-
maxLength: o,
|
|
77
|
-
onChange: C,
|
|
78
|
-
state: i,
|
|
79
|
-
size: r ? e === "xl" || e === "lg" ? e : "xl" : e,
|
|
80
|
-
...n
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
r && /* @__PURE__ */ t(
|
|
84
|
-
_,
|
|
9
|
+
const H = c.forwardRef(
|
|
10
|
+
({
|
|
11
|
+
className: b,
|
|
12
|
+
label: u,
|
|
13
|
+
helperText: i,
|
|
14
|
+
state: m,
|
|
15
|
+
size: e = "normal",
|
|
16
|
+
isFloatLabel: r,
|
|
17
|
+
maxLength: s,
|
|
18
|
+
showCharCount: g,
|
|
19
|
+
infoTooltip: f,
|
|
20
|
+
clearable: h,
|
|
21
|
+
onClear: v,
|
|
22
|
+
placeholder: y = " ",
|
|
23
|
+
onChange: w,
|
|
24
|
+
...n
|
|
25
|
+
}, I) => {
|
|
26
|
+
const [p, N] = c.useState(() => typeof n.value == "string" ? n.value.length : typeof n.defaultValue == "string" ? n.defaultValue.length : 0), R = (o) => {
|
|
27
|
+
N(o.target.value.length), w?.(o);
|
|
28
|
+
}, x = c.useId(), a = c.useRef(null);
|
|
29
|
+
c.useImperativeHandle(I, () => a.current);
|
|
30
|
+
const j = () => {
|
|
31
|
+
if (a.current) {
|
|
32
|
+
a.current.value = "", N(0);
|
|
33
|
+
const o = new Event("input", { bubbles: !0 });
|
|
34
|
+
a.current.dispatchEvent(o), v && v();
|
|
35
|
+
}
|
|
36
|
+
}, C = {
|
|
37
|
+
default: "text-muted-foreground",
|
|
38
|
+
success: "text-success",
|
|
39
|
+
warning: "text-warning",
|
|
40
|
+
error: "text-error"
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ t("div", { className: b, children: /* @__PURE__ */ l(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: d("flex flex-col gap-1.5 relative", {
|
|
46
|
+
"floating-label": r
|
|
47
|
+
}),
|
|
48
|
+
children: [
|
|
49
|
+
!r && u && /* @__PURE__ */ l(
|
|
50
|
+
k,
|
|
85
51
|
{
|
|
86
52
|
htmlFor: x,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
),
|
|
93
|
-
h && p > 0 && /* @__PURE__ */ t(
|
|
94
|
-
"button",
|
|
95
|
-
{
|
|
96
|
-
type: "button",
|
|
97
|
-
tabIndex: -1,
|
|
98
|
-
className: d(
|
|
99
|
-
"absolute top-2 right-2 p-1 rounded hover:bg-accent transition-colors"
|
|
100
|
-
),
|
|
101
|
-
onClick: R,
|
|
102
|
-
disabled: n.disabled,
|
|
103
|
-
children: /* @__PURE__ */ t(S, { className: "size-4" })
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
] }),
|
|
107
|
-
(m || g && typeof o == "number") && /* @__PURE__ */ l("div", { className: "flex items-center justify-between text-xs gap-2", children: [
|
|
108
|
-
m && /* @__PURE__ */ t(
|
|
109
|
-
"p",
|
|
110
|
-
{
|
|
111
|
-
className: d(
|
|
112
|
-
"text-xs",
|
|
113
|
-
i ? j?.[i] : ""
|
|
114
|
-
),
|
|
115
|
-
children: m
|
|
53
|
+
className: "flex gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
54
|
+
children: [
|
|
55
|
+
u,
|
|
56
|
+
f && /* @__PURE__ */ t(V, { content: f, children: /* @__PURE__ */ t(S, { className: "size-3.5 min-w-3.5" }) })
|
|
57
|
+
]
|
|
116
58
|
}
|
|
117
59
|
),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
60
|
+
/* @__PURE__ */ l("div", { className: "relative", children: [
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
E,
|
|
63
|
+
{
|
|
64
|
+
ref: a,
|
|
65
|
+
id: x,
|
|
66
|
+
className: d(
|
|
67
|
+
"peer resize-y",
|
|
68
|
+
{
|
|
69
|
+
"pt-6 pb-2": r && (e === "lg" || e === "xl"),
|
|
70
|
+
"pt-6 pb-1": r && e !== "lg" && e !== "xl",
|
|
71
|
+
"text-lg": (e === "xl" || e === "lg") && !r
|
|
72
|
+
},
|
|
73
|
+
h && p > 0 && "pr-10"
|
|
74
|
+
// className
|
|
75
|
+
),
|
|
76
|
+
placeholder: y,
|
|
77
|
+
maxLength: s,
|
|
78
|
+
onChange: R,
|
|
79
|
+
state: m,
|
|
80
|
+
size: r ? e === "xl" || e === "lg" ? e : "xl" : e,
|
|
81
|
+
...n
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
r && /* @__PURE__ */ t(
|
|
85
|
+
_,
|
|
86
|
+
{
|
|
87
|
+
htmlFor: x,
|
|
88
|
+
size: e,
|
|
89
|
+
infoTooltip: f,
|
|
90
|
+
className: "peer-placeholder-shown:items-start",
|
|
91
|
+
children: u
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
h && p > 0 && /* @__PURE__ */ t(
|
|
95
|
+
"button",
|
|
96
|
+
{
|
|
97
|
+
type: "button",
|
|
98
|
+
tabIndex: -1,
|
|
99
|
+
className: d(
|
|
100
|
+
"absolute top-2 right-2 p-1 rounded hover:bg-accent transition-colors"
|
|
101
|
+
),
|
|
102
|
+
onClick: j,
|
|
103
|
+
disabled: n.disabled,
|
|
104
|
+
children: /* @__PURE__ */ t(T, { className: "size-4" })
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] }),
|
|
108
|
+
(i || g && typeof s == "number") && /* @__PURE__ */ l("div", { className: "flex items-center justify-between text-xs gap-2", children: [
|
|
109
|
+
i && /* @__PURE__ */ t(
|
|
110
|
+
"p",
|
|
111
|
+
{
|
|
112
|
+
className: d(
|
|
113
|
+
"text-xs",
|
|
114
|
+
m ? C?.[m] : ""
|
|
115
|
+
),
|
|
116
|
+
children: i
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
g && typeof s == "number" && /* @__PURE__ */ l("span", { className: "ml-auto text-muted-foreground", children: [
|
|
120
|
+
p,
|
|
121
|
+
" / ",
|
|
122
|
+
s
|
|
123
|
+
] })
|
|
122
124
|
] })
|
|
123
|
-
]
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
) });
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
H.displayName = "Textarea";
|
|
129
131
|
export {
|
|
130
|
-
|
|
132
|
+
H as default
|
|
131
133
|
};
|
|
132
134
|
//# sourceMappingURL=Textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n Textarea as STextarea,\n type TextareaProps as STextareaProps,\n} from \"@dsui/ui/components/textarea\";\nimport { cn } from \"@dsui/ui/lib/utils\";\nimport { Info, X } from \"lucide-react\";\nimport { Tooltip } from \"../Tooltip/Tooltip\";\nimport { FloatingLabel } from \"@/components/FloatLabel\";\nimport { Label } from \"../Label\";\n\nexport type TextareaProps = Omit<\n STextareaProps,\n \"onChange\" | \"size\" | \"state\"\n> & {\n onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n size?: \"xs\" | \"sm\" | \"normal\" | \"lg\" | \"xl\";\n state?: \"default\" | \"success\" | \"warning\" | \"error\";\n label?: string;\n helperText?: React.ReactNode;\n isFloatLabel?: boolean;\n maxLength?: number;\n showCharCount?: boolean;\n infoTooltip?: React.ReactNode;\n clearable?: boolean;\n onClear?: () => void;\n};\n\nconst
|
|
1
|
+
{"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n Textarea as STextarea,\n type TextareaProps as STextareaProps,\n} from \"@dsui/ui/components/textarea\";\nimport { cn } from \"@dsui/ui/lib/utils\";\nimport { Info, X } from \"lucide-react\";\nimport { Tooltip } from \"../Tooltip/Tooltip\";\nimport { FloatingLabel } from \"@/components/FloatLabel\";\nimport { Label } from \"../Label\";\n\nexport type TextareaProps = Omit<\n STextareaProps,\n \"onChange\" | \"size\" | \"state\"\n> & {\n onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n size?: \"xs\" | \"sm\" | \"normal\" | \"lg\" | \"xl\";\n state?: \"default\" | \"success\" | \"warning\" | \"error\";\n label?: string;\n helperText?: React.ReactNode;\n isFloatLabel?: boolean;\n maxLength?: number;\n showCharCount?: boolean;\n infoTooltip?: React.ReactNode;\n clearable?: boolean;\n onClear?: () => void;\n};\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n className,\n label,\n helperText,\n state,\n size = \"normal\",\n isFloatLabel,\n maxLength,\n showCharCount,\n infoTooltip,\n clearable,\n onClear,\n placeholder = \" \",\n onChange,\n ...props\n },\n ref\n ) => {\n // Character count state\n const [charCount, setCharCount] = React.useState(() => {\n if (typeof props.value === \"string\") return props.value.length;\n if (typeof props.defaultValue === \"string\")\n return props.defaultValue.length;\n return 0;\n });\n\n const handleInput = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setCharCount(e.target.value.length);\n onChange?.(e);\n };\n\n const textareaId = React.useId();\n const innerRef = React.useRef<HTMLTextAreaElement>(null);\n\n // Combine refs\n React.useImperativeHandle(ref, () => innerRef.current!);\n\n const handleClear = () => {\n if (innerRef.current) {\n innerRef.current.value = \"\";\n setCharCount(0);\n const event = new Event(\"input\", { bubbles: true });\n innerRef.current.dispatchEvent(event);\n if (onClear) onClear();\n }\n };\n\n // State\n const helperTextStyles = {\n default: \"text-muted-foreground\",\n success: \"text-success\",\n warning: \"text-warning\",\n error: \"text-error\",\n };\n\n return (\n <div className={className}>\n <div\n className={cn(\"flex flex-col gap-1.5 relative\", {\n \"floating-label\": isFloatLabel,\n })}\n >\n {!isFloatLabel && label && (\n <Label\n htmlFor={textareaId}\n className=\"flex gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {infoTooltip && (\n <Tooltip content={infoTooltip}>\n <Info className=\"size-3.5 min-w-3.5\" />\n </Tooltip>\n )}\n </Label>\n )}\n\n <div className=\"relative\">\n <STextarea\n ref={innerRef}\n id={textareaId}\n className={cn(\n \"peer resize-y\",\n {\n \"pt-6 pb-2\": isFloatLabel && (size === \"lg\" || size === \"xl\"),\n \"pt-6 pb-1\": isFloatLabel && size !== \"lg\" && size !== \"xl\",\n \"text-lg\": (size === \"xl\" || size === \"lg\") && !isFloatLabel,\n },\n clearable && charCount > 0 && \"pr-10\"\n // className\n )}\n placeholder={placeholder}\n maxLength={maxLength}\n onChange={handleInput}\n state={state}\n size={\n isFloatLabel\n ? size === \"xl\" || size === \"lg\"\n ? size\n : \"xl\"\n : size\n }\n {...props}\n />\n {isFloatLabel && (\n <FloatingLabel\n htmlFor={textareaId}\n size={size}\n infoTooltip={infoTooltip}\n className=\"peer-placeholder-shown:items-start\"\n >\n {label}\n </FloatingLabel>\n )}\n\n {/* Clear Button */}\n {clearable && charCount > 0 && (\n <button\n type=\"button\"\n tabIndex={-1}\n className={cn(\n \"absolute top-2 right-2 p-1 rounded hover:bg-accent transition-colors\"\n )}\n onClick={handleClear}\n disabled={props.disabled}\n >\n <X className=\"size-4\" />\n </button>\n )}\n </div>\n\n {(helperText || (showCharCount && typeof maxLength === \"number\")) && (\n <div className=\"flex items-center justify-between text-xs gap-2\">\n {helperText && (\n <p\n className={cn(\n \"text-xs\",\n state ? helperTextStyles?.[state] : \"\"\n )}\n >\n {helperText}\n </p>\n )}\n {showCharCount && typeof maxLength === \"number\" && (\n <span className=\"ml-auto text-muted-foreground\">\n {charCount} / {maxLength}\n </span>\n )}\n </div>\n )}\n </div>\n </div>\n );\n }\n);\n\nTextarea.displayName = \"Textarea\";\nexport default Textarea;\n"],"names":["Textarea","React","className","label","helperText","state","size","isFloatLabel","maxLength","showCharCount","infoTooltip","clearable","onClear","placeholder","onChange","props","ref","charCount","setCharCount","handleInput","e","textareaId","innerRef","handleClear","event","helperTextStyles","jsx","jsxs","cn","Label","Tooltip","Info","STextarea","FloatingLabel","X"],"mappings":";;;;;;;;AA4BA,MAAMA,IAAWC,EAAM;AAAA,EACrB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AAEH,UAAM,CAACC,GAAWC,CAAY,IAAIjB,EAAM,SAAS,MAC3C,OAAOc,EAAM,SAAU,WAAiBA,EAAM,MAAM,SACpD,OAAOA,EAAM,gBAAiB,WACzBA,EAAM,aAAa,SACrB,CACR,GAEKI,IAAc,CAACC,MAA8C;AACjE,MAAAF,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AAAA,UAAA,EAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAGN;AAAA,EAEJ;AACF;AAEAR,EAAS,cAAc;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AccordionItem, AccordionTrigger, AccordionContent } from "
|
|
2
|
+
import { AccordionItem, AccordionTrigger, AccordionContent } from "@dsui/ui/components/accordion";
|
|
3
3
|
import { type BasicColor } from "../../types/variables";
|
|
4
4
|
export type AccordionItemConfig = {
|
|
5
5
|
value: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Avatar as DsAvatar } from "
|
|
2
|
+
import { Avatar as DsAvatar } from "@dsui/ui/components/avatar";
|
|
3
3
|
import type { BasicAnimation, BasicColor } from "../../types/variables";
|
|
4
4
|
type Color = BasicColor | "dark" | "light" | "inverted";
|
|
5
5
|
type Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type BadgeProps as SBadgeProps } from "
|
|
2
|
+
import { type BadgeProps as SBadgeProps } from "@dsui/ui/components/badge";
|
|
3
3
|
import type { BadgeAnimation } from "../../types/variables";
|
|
4
4
|
export type BadgeProps = SBadgeProps & {
|
|
5
5
|
animation?: BadgeAnimation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type ButtonProps as SButtonProps } from "
|
|
2
|
+
import { type ButtonProps as SButtonProps } from "@dsui/ui/components/button";
|
|
3
3
|
import type { ButtonAnimation } from "../../types/variables";
|
|
4
4
|
export type ButtonProps = SButtonProps & {
|
|
5
5
|
animation?: ButtonAnimation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ButtonGroup as SButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants } from "
|
|
2
|
+
import { ButtonGroup as SButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants } from "@dsui/ui/components/button-group";
|
|
3
3
|
import { type VariantProps } from "class-variance-authority";
|
|
4
4
|
import { type ButtonProps } from "./Button";
|
|
5
5
|
export type ButtonGroupProps = React.ComponentProps<typeof SButtonGroup> & VariantProps<typeof buttonGroupVariants> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalendarDayButton as SCalendarDayButton, type CalendarDayButtonProps as SCalendarDayButtonProps, type CalendarProps as SCalendarProps, type CalendarColor } from "
|
|
1
|
+
import { CalendarDayButton as SCalendarDayButton, type CalendarDayButtonProps as SCalendarDayButtonProps, type CalendarProps as SCalendarProps, type CalendarColor } from "@dsui/ui/components/calendar";
|
|
2
2
|
export type DateRange = {
|
|
3
3
|
from: Date | undefined;
|
|
4
4
|
to?: Date | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Checkbox as SCheckbox } from "
|
|
2
|
+
import { Checkbox as SCheckbox } from "@dsui/ui/components/checkbox";
|
|
3
3
|
import type { CheckedState } from "@radix-ui/react-checkbox";
|
|
4
4
|
export type CheckboxProps = Omit<React.ComponentPropsWithoutRef<typeof SCheckbox>, "onCheckedChange" | "variant" | "size" | "color" | "icon"> & {
|
|
5
5
|
onCheckedChange?: (checked: CheckedState) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Collapsible as SCollapsible, CollapsibleTrigger, CollapsibleContent } from "
|
|
2
|
+
import { Collapsible as SCollapsible, CollapsibleTrigger, CollapsibleContent } from "@dsui/ui/components/collapsible";
|
|
3
3
|
export type CollapsibleProps = Omit<React.ComponentPropsWithoutRef<typeof SCollapsible>, "children" | "content" | "open" | "defaultOpen" | "onOpenChange"> & {
|
|
4
4
|
open?: boolean;
|
|
5
5
|
defaultOpen?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CommandProps, type CommandItemType } from "./Command";
|
|
2
|
-
import { CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandSeparator, CommandItem, CommandShortcut } from "
|
|
2
|
+
import { CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandSeparator, CommandItem, CommandShortcut } from "@dsui/ui/components/command";
|
|
3
3
|
declare const Command: import("react").ForwardRefExoticComponent<CommandProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
4
4
|
Dialog: typeof CommandDialog;
|
|
5
5
|
Input: typeof CommandInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ContextMenuProps } from "./ContextMenu";
|
|
2
|
-
import { ContextMenu as ContextMenuPrimitive, ContextMenuPortal, ContextMenuTrigger, ContextMenuContent, ContextMenuGroup, ContextMenuLabel, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubTrigger, ContextMenuSubContent } from "
|
|
2
|
+
import { ContextMenu as ContextMenuPrimitive, ContextMenuPortal, ContextMenuTrigger, ContextMenuContent, ContextMenuGroup, ContextMenuLabel, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubTrigger, ContextMenuSubContent } from "@dsui/ui/components/context-menu";
|
|
3
3
|
declare const ContextMenu: import("react").ForwardRefExoticComponent<ContextMenuProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
4
4
|
Root: typeof ContextMenuPrimitive;
|
|
5
5
|
Portal: typeof ContextMenuPortal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { CalendarDayButton as SCalendarDayButton, type CalendarDayButtonProps as SCalendarDayButtonProps, type CalendarProps, type CalendarColor } from "
|
|
2
|
+
import { CalendarDayButton as SCalendarDayButton, type CalendarDayButtonProps as SCalendarDayButtonProps, type CalendarProps, type CalendarColor } from "@dsui/ui/components/calendar";
|
|
3
3
|
import { Input, type InputProps } from "../Input";
|
|
4
4
|
import { type TimePickerMode, type DisabledTimeRange } from "./TimePicker";
|
|
5
5
|
import type { VariantProps } from "class-variance-authority";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { CalendarDayButton as SCalendarDayButton, type CalendarDayButtonProps as SCalendarDayButtonProps, type CalendarColor } from "
|
|
2
|
+
import { CalendarDayButton as SCalendarDayButton, type CalendarDayButtonProps as SCalendarDayButtonProps, type CalendarColor } from "@dsui/ui/components/calendar";
|
|
3
3
|
import { TimePicker } from "./TimePicker";
|
|
4
4
|
import { type DatePickerProps } from "./DatePicker";
|
|
5
5
|
export type DateRange = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DropdownMenuProps } from "./DropdownMenu";
|
|
2
|
-
import { DropdownMenu as DropdownMenuPrimitive, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from "
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from "@dsui/ui/components/dropdown-menu";
|
|
3
3
|
declare const DropdownMenu: import("react").ForwardRefExoticComponent<DropdownMenuProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
4
4
|
Root: typeof DropdownMenuPrimitive;
|
|
5
5
|
Portal: typeof DropdownMenuPortal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type InputOTPProps as SInputOTPProps, inputOTPSlotVariants } from "
|
|
2
|
+
import { type InputOTPProps as SInputOTPProps, inputOTPSlotVariants } from "@dsui/ui/components/input-otp";
|
|
3
3
|
import type { VariantProps } from "class-variance-authority";
|
|
4
4
|
export type InputOTPProps = Omit<SInputOTPProps, "size" | "render" | "maxLength"> & {
|
|
5
5
|
label?: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Pagination as SPagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis } from "
|
|
2
|
+
import { Pagination as SPagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis } from "@dsui/ui/components/pagination";
|
|
3
3
|
import type { ButtonAnimation } from "../../types/variables";
|
|
4
4
|
import type { Button } from "../Button";
|
|
5
5
|
type PaginationItemType = number | "..." | {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { RadioGroup as SRadioGroup, type RadioGroupProps, type RadioGroupItemProps } from "
|
|
2
|
+
import { RadioGroup as SRadioGroup, type RadioGroupProps, type RadioGroupItemProps } from "@dsui/ui/components/radio-group";
|
|
3
3
|
export type RadioItemProps = RadioGroupItemProps & {
|
|
4
4
|
label?: React.ReactNode;
|
|
5
5
|
variant?: "option" | "button-group";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ResizablePanelGroup, ResizablePanel, ResizableHandle, resizableHandleVariants } from "
|
|
2
|
+
import { ResizablePanelGroup, ResizablePanel, ResizableHandle, resizableHandleVariants } from "@dsui/ui/components/resizable";
|
|
3
3
|
import type { VariantProps } from "class-variance-authority";
|
|
4
4
|
export type ResizableDirection = "horizontal" | "vertical";
|
|
5
5
|
export type ResizableHandleVariant = VariantProps<typeof resizableHandleVariants>["variant"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ScrollArea as SScrollArea, ScrollBar as SScrollBar } from "
|
|
2
|
+
import { ScrollArea as SScrollArea, ScrollBar as SScrollBar } from "@dsui/ui/components/scroll-area";
|
|
3
3
|
export interface ScrollAreaProps extends React.ComponentProps<typeof SScrollArea> {
|
|
4
4
|
/**
|
|
5
5
|
* Type of scroll snap behavior
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type ComboboxProps, type SelectOption as SSelectOption } from "
|
|
2
|
+
import { type ComboboxProps, type SelectOption as SSelectOption } from "@dsui/ui/components/combobox";
|
|
3
3
|
export type SelectOption = SSelectOption;
|
|
4
4
|
export type SelectProps = ComboboxProps & {
|
|
5
5
|
label?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SeparatorProps } from "
|
|
1
|
+
import { type SeparatorProps } from "@dsui/ui/components/separator";
|
|
2
2
|
declare const Separator: (props: SeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Separator;
|
|
4
4
|
export type { SeparatorProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { SheetClose } from "
|
|
3
|
-
import { DrawerClose } from "
|
|
2
|
+
import { SheetClose } from "@dsui/ui/components/sheet";
|
|
3
|
+
import { DrawerClose } from "@dsui/ui/components/drawer";
|
|
4
4
|
import type { BasicAnimation } from "../../types/variables";
|
|
5
5
|
export type SheetSide = "top" | "right" | "bottom" | "left";
|
|
6
6
|
export type SheetSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Sidebar as SSidebar, SidebarProvider as SSidebarProvider, SidebarContent as SSidebarContent, SidebarFooter as SSidebarFooter, SidebarGroup as SSidebarGroup, SidebarGroupAction as SSidebarGroupAction, SidebarGroupContent as SSidebarGroupContent, SidebarGroupLabel as SSidebarGroupLabel, SidebarHeader as SSidebarHeader, SidebarInput as SSidebarInput, SidebarInset as SSidebarInset, SidebarMenu as SSidebarMenu, SidebarMenuAction as SSidebarMenuAction, SidebarMenuBadge as SSidebarMenuBadge, SidebarMenuButton as SSidebarMenuButton, SidebarMenuItem as SSidebarMenuItem, SidebarMenuSkeleton as SSidebarMenuSkeleton, SidebarMenuSub as SSidebarMenuSub, SidebarMenuSubButton as SSidebarMenuSubButton, SidebarMenuSubItem as SSidebarMenuSubItem, SidebarRail as SSidebarRail, SidebarSeparator as SSidebarSeparator, SidebarTrigger as SSidebarTrigger } from "
|
|
2
|
+
import { Sidebar as SSidebar, SidebarProvider as SSidebarProvider, SidebarContent as SSidebarContent, SidebarFooter as SSidebarFooter, SidebarGroup as SSidebarGroup, SidebarGroupAction as SSidebarGroupAction, SidebarGroupContent as SSidebarGroupContent, SidebarGroupLabel as SSidebarGroupLabel, SidebarHeader as SSidebarHeader, SidebarInput as SSidebarInput, SidebarInset as SSidebarInset, SidebarMenu as SSidebarMenu, SidebarMenuAction as SSidebarMenuAction, SidebarMenuBadge as SSidebarMenuBadge, SidebarMenuButton as SSidebarMenuButton, SidebarMenuItem as SSidebarMenuItem, SidebarMenuSkeleton as SSidebarMenuSkeleton, SidebarMenuSub as SSidebarMenuSub, SidebarMenuSubButton as SSidebarMenuSubButton, SidebarMenuSubItem as SSidebarMenuSubItem, SidebarRail as SSidebarRail, SidebarSeparator as SSidebarSeparator, SidebarTrigger as SSidebarTrigger } from "@dsui/ui/components/sidebar";
|
|
3
3
|
export type SidebarProviderProps = React.ComponentProps<typeof SSidebarProvider>;
|
|
4
4
|
export type SidebarProps = React.ComponentProps<typeof SSidebar>;
|
|
5
5
|
export type SidebarContentProps = React.ComponentProps<typeof SSidebarContent>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Skeleton as SSkeleton } from "
|
|
2
|
+
import { Skeleton as SSkeleton } from "@dsui/ui/components/skeleton";
|
|
3
3
|
export type SkeletonProps = React.ComponentProps<typeof SSkeleton>;
|
|
4
4
|
declare const Skeleton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default Skeleton;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Switch as SSwitch } from "
|
|
2
|
+
import { Switch as SSwitch } from "@dsui/ui/components/switch";
|
|
3
3
|
import type { SwitchAnimation } from "../../types/variables";
|
|
4
4
|
export type SwitchProps = Omit<React.ComponentPropsWithoutRef<typeof SSwitch>, "onCheckedChange" | "variant" | "size" | "color"> & {
|
|
5
5
|
onCheckedChange?: (checked: boolean) => void;
|