@xjur-ui/react 2.2.0 → 2.2.1
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/CHANGELOG.md +6 -0
- package/dist/{chunk-DT44JTXB.js → chunk-4M3WR2KJ.js} +2 -2
- package/dist/{chunk-DT44JTXB.js.map → chunk-4M3WR2KJ.js.map} +1 -1
- package/dist/{chunk-7HG6Y3VV.js → chunk-BYXTOSM6.js} +2 -2
- package/dist/{chunk-7HG6Y3VV.js.map → chunk-BYXTOSM6.js.map} +1 -1
- package/dist/{chunk-4PTFZTVU.js → chunk-HLWHETF5.js} +2 -2
- package/dist/{chunk-4PTFZTVU.js.map → chunk-HLWHETF5.js.map} +1 -1
- package/dist/{chunk-ASZAHSU5.js → chunk-SLMHDBWO.js} +2 -2
- package/dist/{chunk-ASZAHSU5.js.map → chunk-SLMHDBWO.js.map} +1 -1
- package/dist/{chunk-MQ7YTZBI.js → chunk-TTKENFBF.js} +2 -2
- package/dist/{chunk-MQ7YTZBI.js.map → chunk-TTKENFBF.js.map} +1 -1
- package/dist/components/accordion.d.ts +54 -0
- package/dist/components/accordion.js +2 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/controls/rating.d.ts +137 -0
- package/dist/components/controls/rating.js +2 -0
- package/dist/components/controls/rating.js.map +1 -0
- package/dist/components/controls/rich-editor.js +1 -1
- package/dist/components/controls/slider.d.ts +172 -0
- package/dist/components/controls/slider.js +2 -0
- package/dist/components/controls/slider.js.map +1 -0
- package/dist/components/custom/pessoa/index.js +1 -1
- package/dist/components/drag-and-drop/index.js +1 -1
- package/dist/components/full-calendar/calendar-cell.js +1 -1
- package/dist/components/full-calendar/calendar-day-view.js +1 -1
- package/dist/components/full-calendar/calendar-month-view.js +1 -1
- package/dist/components/full-calendar/calendar-view-renderer.js +1 -1
- package/dist/components/full-calendar/calendar-week-view.js +1 -1
- package/dist/components/full-calendar/index.js +1 -1
- package/dist/components/selection-bar.d.ts +1 -1
- package/dist/components/status.d.ts +1 -1
- package/dist/components/steps/index.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/toast.d.ts +27 -0
- package/dist/components/toast.js +2 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/typography.d.ts +1 -1
- package/dist/components/upload.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +19 -13
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
4
|
+
import { ComponentProps } from 'react';
|
|
5
|
+
import { FloatingLabel } from './floating-label.js';
|
|
6
|
+
|
|
7
|
+
declare const slider: tailwind_variants.TVReturnType<{
|
|
8
|
+
orientation: {
|
|
9
|
+
horizontal: {
|
|
10
|
+
root: string;
|
|
11
|
+
track: string;
|
|
12
|
+
range: string;
|
|
13
|
+
thumb: string;
|
|
14
|
+
};
|
|
15
|
+
vertical: {
|
|
16
|
+
root: string;
|
|
17
|
+
track: string;
|
|
18
|
+
range: string;
|
|
19
|
+
thumb: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
state: {
|
|
23
|
+
normal: {
|
|
24
|
+
track: string;
|
|
25
|
+
range: string;
|
|
26
|
+
thumb: string;
|
|
27
|
+
};
|
|
28
|
+
error: {
|
|
29
|
+
track: string;
|
|
30
|
+
range: string;
|
|
31
|
+
thumb: string;
|
|
32
|
+
caption: string;
|
|
33
|
+
};
|
|
34
|
+
disabled: {
|
|
35
|
+
track: string;
|
|
36
|
+
range: string;
|
|
37
|
+
thumb: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
wrapper: string;
|
|
42
|
+
root: string;
|
|
43
|
+
track: string;
|
|
44
|
+
range: string;
|
|
45
|
+
thumb: string;
|
|
46
|
+
input: string;
|
|
47
|
+
caption: string;
|
|
48
|
+
}, undefined, {
|
|
49
|
+
orientation: {
|
|
50
|
+
horizontal: {
|
|
51
|
+
root: string;
|
|
52
|
+
track: string;
|
|
53
|
+
range: string;
|
|
54
|
+
thumb: string;
|
|
55
|
+
};
|
|
56
|
+
vertical: {
|
|
57
|
+
root: string;
|
|
58
|
+
track: string;
|
|
59
|
+
range: string;
|
|
60
|
+
thumb: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
state: {
|
|
64
|
+
normal: {
|
|
65
|
+
track: string;
|
|
66
|
+
range: string;
|
|
67
|
+
thumb: string;
|
|
68
|
+
};
|
|
69
|
+
error: {
|
|
70
|
+
track: string;
|
|
71
|
+
range: string;
|
|
72
|
+
thumb: string;
|
|
73
|
+
caption: string;
|
|
74
|
+
};
|
|
75
|
+
disabled: {
|
|
76
|
+
track: string;
|
|
77
|
+
range: string;
|
|
78
|
+
thumb: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
}, {
|
|
82
|
+
wrapper: string;
|
|
83
|
+
root: string;
|
|
84
|
+
track: string;
|
|
85
|
+
range: string;
|
|
86
|
+
thumb: string;
|
|
87
|
+
input: string;
|
|
88
|
+
caption: string;
|
|
89
|
+
}, tailwind_variants.TVReturnType<{
|
|
90
|
+
orientation: {
|
|
91
|
+
horizontal: {
|
|
92
|
+
root: string;
|
|
93
|
+
track: string;
|
|
94
|
+
range: string;
|
|
95
|
+
thumb: string;
|
|
96
|
+
};
|
|
97
|
+
vertical: {
|
|
98
|
+
root: string;
|
|
99
|
+
track: string;
|
|
100
|
+
range: string;
|
|
101
|
+
thumb: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
state: {
|
|
105
|
+
normal: {
|
|
106
|
+
track: string;
|
|
107
|
+
range: string;
|
|
108
|
+
thumb: string;
|
|
109
|
+
};
|
|
110
|
+
error: {
|
|
111
|
+
track: string;
|
|
112
|
+
range: string;
|
|
113
|
+
thumb: string;
|
|
114
|
+
caption: string;
|
|
115
|
+
};
|
|
116
|
+
disabled: {
|
|
117
|
+
track: string;
|
|
118
|
+
range: string;
|
|
119
|
+
thumb: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
}, {
|
|
123
|
+
wrapper: string;
|
|
124
|
+
root: string;
|
|
125
|
+
track: string;
|
|
126
|
+
range: string;
|
|
127
|
+
thumb: string;
|
|
128
|
+
input: string;
|
|
129
|
+
caption: string;
|
|
130
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
131
|
+
interface SliderRootProps extends ComponentProps<typeof SliderPrimitive.Root> {
|
|
132
|
+
state?: 'normal' | 'error' | 'disabled';
|
|
133
|
+
orientation?: 'horizontal' | 'vertical';
|
|
134
|
+
className?: string;
|
|
135
|
+
}
|
|
136
|
+
declare function SliderRoot({ className, state, orientation, ...props }: SliderRootProps): react_jsx_runtime.JSX.Element;
|
|
137
|
+
interface SliderTrackProps extends ComponentProps<typeof SliderPrimitive.Track> {
|
|
138
|
+
className?: string;
|
|
139
|
+
}
|
|
140
|
+
declare function SliderTrack({ className, ...props }: SliderTrackProps): react_jsx_runtime.JSX.Element;
|
|
141
|
+
interface SliderRangeProps extends ComponentProps<typeof SliderPrimitive.Range> {
|
|
142
|
+
className?: string;
|
|
143
|
+
}
|
|
144
|
+
declare function SliderRange({ className, ...props }: SliderRangeProps): react_jsx_runtime.JSX.Element;
|
|
145
|
+
interface SliderThumbProps extends ComponentProps<typeof SliderPrimitive.Thumb> {
|
|
146
|
+
className?: string;
|
|
147
|
+
}
|
|
148
|
+
declare function SliderThumb({ className, ...props }: SliderThumbProps): react_jsx_runtime.JSX.Element;
|
|
149
|
+
type SliderLabelProps = ComponentProps<typeof FloatingLabel>;
|
|
150
|
+
declare function SliderLabel(props: SliderLabelProps): react_jsx_runtime.JSX.Element;
|
|
151
|
+
interface SliderCaptionProps extends ComponentProps<'p'> {
|
|
152
|
+
className?: string;
|
|
153
|
+
}
|
|
154
|
+
declare function SliderCaption({ className, ...props }: SliderCaptionProps): react_jsx_runtime.JSX.Element;
|
|
155
|
+
interface SliderProps {
|
|
156
|
+
value?: number[];
|
|
157
|
+
defaultValue?: number[];
|
|
158
|
+
onValueChange?: (value: number[]) => void;
|
|
159
|
+
min?: number;
|
|
160
|
+
max?: number;
|
|
161
|
+
step?: number;
|
|
162
|
+
orientation?: 'horizontal' | 'vertical';
|
|
163
|
+
state?: 'normal' | 'error' | 'disabled';
|
|
164
|
+
label?: string;
|
|
165
|
+
caption?: string;
|
|
166
|
+
className?: string;
|
|
167
|
+
disabled?: boolean;
|
|
168
|
+
id?: string;
|
|
169
|
+
}
|
|
170
|
+
declare function Slider({ value, defaultValue, onValueChange: handleValueChange, min, max, step, orientation, state, label, caption, className, disabled, id, ...props }: SliderProps): react_jsx_runtime.JSX.Element;
|
|
171
|
+
|
|
172
|
+
export { Slider, SliderCaption, type SliderCaptionProps, SliderLabel, type SliderLabelProps, type SliderProps, SliderRange, type SliderRangeProps, SliderRoot, type SliderRootProps, SliderThumb, type SliderThumbProps, SliderTrack, type SliderTrackProps, slider };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1}from'../../chunk-JGPHBUVM.js';import {a,b}from'../../chunk-2JQVYVAT.js';import*as i from'@radix-ui/react-slider';import {tv}from'@xjur-ui/util';import {jsx,jsxs}from'react/jsx-runtime';var x=tv({slots:{wrapper:"group flex w-full flex-col gap-small-2x",root:"relative flex w-full touch-none select-none items-center",track:"relative h-2 w-full grow overflow-hidden rounded-full bg-gray-200",range:"absolute h-full bg-orange-500",thumb:"block h-5 w-5 rounded-full border-2 border-orange-500 bg-white shadow-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-orange-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",input:"sr-only",caption:"!text-size-body-sm font-normal"},variants:{orientation:{horizontal:{root:"flex-row",track:"h-2 w-full",range:"h-full",thumb:"h-5 w-5"},vertical:{root:"flex-col h-64 w-6",track:"w-2 h-full",range:"w-full",thumb:"h-5 w-5"}},state:{normal:{track:"bg-gray-200",range:"bg-orange-500",thumb:"border-orange-500 bg-white focus-visible:ring-orange-500"},error:{track:"bg-danger-idle",range:"bg-danger-idle",thumb:"border-danger-idle bg-white focus-visible:ring-danger-idle",caption:"text-danger-label-idle"},disabled:{track:"bg-gray-200 opacity-50",range:"bg-orange-500 opacity-50",thumb:"border-orange-500 bg-white opacity-50"}}}}),{wrapper:P,root:w,track:C,range:y,thumb:k,caption:N}=x();function R({className:e,state:r="normal",orientation:t="horizontal",...a$1}){return jsx(a.Provider,{value:{state:r},children:jsx("div",{className:P({className:e}),children:jsx(i.Root,{className:w({orientation:t,state:r,className:e}),disabled:r==="disabled",orientation:t,...a$1})})})}function T({className:e,...r}){let{state:t}=b();return jsx(i.Track,{className:C({state:t,className:e}),...r})}function z({className:e,...r}){let{state:t}=b();return jsx(i.Range,{className:y({state:t,className:e}),...r})}function L({className:e,...r}){let{state:t}=b();return jsx(i.Thumb,{className:k({state:t,className:e}),...r})}function F(e){return jsx(a$1,{...e})}function V({className:e,...r}){let{state:t}=b();return jsx("p",{className:N({state:t,className:e}),...r})}function G({value:e,defaultValue:r=[0],onValueChange:t,min:a=0,max:m=100,step:c=1,orientation:u="horizontal",state:g="normal",label:l,caption:s,className:b,disabled:f,id:h,...S}){return jsxs(R,{className:b,defaultValue:r,id:h,max:m,min:a,orientation:u,state:f?"disabled":g,step:c,value:e,onValueChange:t,...S,children:[l&&jsx(F,{children:l}),jsx(T,{children:jsx(z,{})}),jsx(L,{}),s&&jsx(V,{children:s})]})}export{G as Slider,V as SliderCaption,F as SliderLabel,z as SliderRange,R as SliderRoot,L as SliderThumb,T as SliderTrack,x as slider};//# sourceMappingURL=slider.js.map
|
|
2
|
+
//# sourceMappingURL=slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/controls/slider.tsx"],"names":["slider","tv","wrapper","root","track","range","thumb","caption","SliderRoot","className","state","orientation","props","jsx","FieldContext","SliderTrack","useFieldContext","SliderRange","SliderThumb","SliderLabel","FloatingLabel","SliderCaption","Slider","value","defaultValue","handleValueChange","min","max","step","label","disabled","id","jsxs"],"mappings":"0MAMO,IAAMA,CAAAA,CAASC,GAAG,CACvB,KAAA,CAAO,CACL,OAAA,CAAS,yCAAA,CACT,IAAA,CAAM,0DAAA,CACN,KAAA,CAAO,mEAAA,CACP,MAAO,+BAAA,CACP,KAAA,CACE,wPACF,KAAA,CAAO,SAAA,CACP,QAAS,gCACX,CAAA,CACA,QAAA,CAAU,CACR,WAAA,CAAa,CACX,WAAY,CACV,IAAA,CAAM,WACN,KAAA,CAAO,YAAA,CACP,MAAO,QAAA,CACP,KAAA,CAAO,SACT,CAAA,CACA,QAAA,CAAU,CACR,KAAM,mBAAA,CACN,KAAA,CAAO,aACP,KAAA,CAAO,QAAA,CACP,MAAO,SACT,CACF,CAAA,CACA,KAAA,CAAO,CACL,MAAA,CAAQ,CACN,KAAA,CAAO,aAAA,CACP,MAAO,eAAA,CACP,KAAA,CAAO,0DACT,CAAA,CACA,KAAA,CAAO,CACL,KAAA,CAAO,gBAAA,CACP,KAAA,CAAO,iBACP,KAAA,CAAO,4DAAA,CACP,QAAS,wBACX,CAAA,CACA,SAAU,CACR,KAAA,CAAO,wBAAA,CACP,KAAA,CAAO,0BAAA,CACP,KAAA,CAAO,uCACT,CACF,CACF,CACF,CAAC,CAAA,CAEK,CAAE,OAAA,CAAAC,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,KAAA,CAAAC,CAAAA,CAAO,MAAAC,CAAAA,CAAO,KAAA,CAAAC,EAAO,OAAA,CAAAC,CAAQ,EAAIP,CAAAA,GASjD,SAASQ,CAAAA,CAAW,CACzB,SAAA,CAAAC,EACA,KAAA,CAAAC,CAAAA,CAAQ,SACR,WAAA,CAAAC,CAAAA,CAAc,aACd,GAAGC,GACL,CAAA,CAAoB,CAClB,OACEC,GAAAA,CAACC,EAAa,QAA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AiB,CAAAA,EAAShB,GAAAA,CAACM,CAAAA,CAAA,CAAa,QAAA,CAAAU,CAAAA,CAAM,EAC9BhB,GAAAA,CAACE,CAAAA,CAAA,CACC,QAAA,CAAAF,GAAAA,CAACI,CAAAA,CAAA,EAAY,CAAA,CACf,CAAA,CACAJ,IAACK,CAAAA,CAAA,EAAY,EACZX,CAAAA,EAAWM,GAAAA,CAACQ,EAAA,CAAe,QAAA,CAAAd,CAAAA,CAAQ,CAAA,CAAA,CACtC,CAEJ","file":"slider.js","sourcesContent":["import * as SliderPrimitive from '@radix-ui/react-slider'\nimport { tv } from '@xjur-ui/util'\nimport type { ComponentProps } from 'react'\nimport { FieldContext, useFieldContext } from './context/field.context'\nimport { FloatingLabel } from './floating-label'\n\nexport const slider = tv({\n slots: {\n wrapper: 'group flex w-full flex-col gap-small-2x',\n root: 'relative flex w-full touch-none select-none items-center',\n track: 'relative h-2 w-full grow overflow-hidden rounded-full bg-gray-200',\n range: 'absolute h-full bg-orange-500',\n thumb:\n 'block h-5 w-5 rounded-full border-2 border-orange-500 bg-white shadow-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-orange-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n input: 'sr-only',\n caption: '!text-size-body-sm font-normal'\n },\n variants: {\n orientation: {\n horizontal: {\n root: 'flex-row',\n track: 'h-2 w-full',\n range: 'h-full',\n thumb: 'h-5 w-5'\n },\n vertical: {\n root: 'flex-col h-64 w-6',\n track: 'w-2 h-full',\n range: 'w-full',\n thumb: 'h-5 w-5'\n }\n },\n state: {\n normal: {\n track: 'bg-gray-200',\n range: 'bg-orange-500',\n thumb: 'border-orange-500 bg-white focus-visible:ring-orange-500'\n },\n error: {\n track: 'bg-danger-idle',\n range: 'bg-danger-idle',\n thumb: 'border-danger-idle bg-white focus-visible:ring-danger-idle',\n caption: 'text-danger-label-idle'\n },\n disabled: {\n track: 'bg-gray-200 opacity-50',\n range: 'bg-orange-500 opacity-50',\n thumb: 'border-orange-500 bg-white opacity-50'\n }\n }\n }\n})\n\nconst { wrapper, root, track, range, thumb, caption } = slider()\n\nexport interface SliderRootProps\n extends ComponentProps<typeof SliderPrimitive.Root> {\n state?: 'normal' | 'error' | 'disabled'\n orientation?: 'horizontal' | 'vertical'\n className?: string\n}\n\nexport function SliderRoot({\n className,\n state = 'normal',\n orientation = 'horizontal',\n ...props\n}: SliderRootProps) {\n return (\n <FieldContext.Provider value={{ state }}>\n <div className={wrapper({ className })}>\n <SliderPrimitive.Root\n className={root({ orientation, state, className })}\n disabled={state === 'disabled'}\n orientation={orientation}\n {...props}\n />\n </div>\n </FieldContext.Provider>\n )\n}\n\nexport interface SliderTrackProps\n extends ComponentProps<typeof SliderPrimitive.Track> {\n className?: string\n}\n\nexport function SliderTrack({ className, ...props }: SliderTrackProps) {\n const { state } = useFieldContext()\n return (\n <SliderPrimitive.Track className={track({ state, className })} {...props} />\n )\n}\n\nexport interface SliderRangeProps\n extends ComponentProps<typeof SliderPrimitive.Range> {\n className?: string\n}\n\nexport function SliderRange({ className, ...props }: SliderRangeProps) {\n const { state } = useFieldContext()\n return (\n <SliderPrimitive.Range className={range({ state, className })} {...props} />\n )\n}\n\nexport interface SliderThumbProps\n extends ComponentProps<typeof SliderPrimitive.Thumb> {\n className?: string\n}\n\nexport function SliderThumb({ className, ...props }: SliderThumbProps) {\n const { state } = useFieldContext()\n return (\n <SliderPrimitive.Thumb className={thumb({ state, className })} {...props} />\n )\n}\n\nexport type SliderLabelProps = ComponentProps<typeof FloatingLabel>\n\nexport function SliderLabel(props: SliderLabelProps) {\n return <FloatingLabel {...props} />\n}\n\nexport interface SliderCaptionProps extends ComponentProps<'p'> {\n className?: string\n}\n\nexport function SliderCaption({ className, ...props }: SliderCaptionProps) {\n const { state } = useFieldContext()\n return <p className={caption({ state, className })} {...props} />\n}\n\nexport interface SliderProps {\n value?: number[]\n defaultValue?: number[]\n onValueChange?: (value: number[]) => void\n min?: number\n max?: number\n step?: number\n orientation?: 'horizontal' | 'vertical'\n state?: 'normal' | 'error' | 'disabled'\n label?: string\n caption?: string\n className?: string\n disabled?: boolean\n id?: string\n}\n\nexport function Slider({\n value,\n defaultValue = [0],\n onValueChange: handleValueChange,\n min = 0,\n max = 100,\n step = 1,\n orientation = 'horizontal',\n state = 'normal',\n label,\n caption,\n className,\n disabled,\n id,\n ...props\n}: SliderProps) {\n const sliderState = disabled ? 'disabled' : state\n\n return (\n <SliderRoot\n className={className}\n defaultValue={defaultValue}\n id={id}\n max={max}\n min={min}\n orientation={orientation}\n state={sliderState}\n step={step}\n value={value}\n onValueChange={handleValueChange}\n {...props}\n >\n {label && <SliderLabel>{label}</SliderLabel>}\n <SliderTrack>\n <SliderRange />\n </SliderTrack>\n <SliderThumb />\n {caption && <SliderCaption>{caption}</SliderCaption>}\n </SliderRoot>\n )\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as
|
|
1
|
+
export{a as PessoaRoot}from'../../../chunk-SSTXFHNX.js';export{a as PessoaAddButton}from'../../../chunk-OLWYBKQR.js';export{a as PessoaBody}from'../../../chunk-TORICLEW.js';export{a as PessoaCloseButton}from'../../../chunk-JF7JKJES.js';export{a as PessoaContent}from'../../../chunk-VCNKCHFF.js';export{a as PessoaFooter}from'../../../chunk-DOC3XTYC.js';export{a as PessoaHeader}from'../../../chunk-4BGAERSD.js';export{a as PessoaTrigger}from'../../../chunk-7QGN6XFA.js';export{a as PessoaContext,b as PessoaProvider,c as usePessoaContext}from'../../../chunk-WEGFAS5P.js';import'../../../chunk-43DUEHUA.js';import'../../../chunk-M6ZI7M3R.js';import'../../../chunk-DVDHTP4C.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as
|
|
1
|
+
export{a as DragListItem}from'../../chunk-BZDGWC5O.js';export{b as DragHandle}from'../../chunk-F5ZLEQGN.js';export{a as DragList}from'../../chunk-DFXHNK5D.js';export{a as DragRoot}from'../../chunk-WEBAXQID.js';export{arrayMove,useSortable}from'@dnd-kit/sortable';export{DragOverlay,closestCenter,closestCorners,getClientRect,getFirstCollision,pointerWithin,useDndContext,useDndMonitor,useDraggable,useDroppable,useSensor,useSensors}from'@dnd-kit/core';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as CalendarCell}from'../../chunk-
|
|
1
|
+
export{a as CalendarCell}from'../../chunk-TTKENFBF.js';import'../../chunk-OKSGVAQQ.js';import'../../chunk-EXC2XOL6.js';import'../../chunk-SXGSWVMZ.js';import'../../chunk-6PHXO2YA.js';import'../../chunk-CBFC4QME.js';import'../../chunk-YOLTIAFT.js';import'../../chunk-M6ZI7M3R.js';import'../../chunk-DVDHTP4C.js';import'../../chunk-EIG6CBTQ.js';//# sourceMappingURL=calendar-cell.js.map
|
|
2
2
|
//# sourceMappingURL=calendar-cell.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as CalendarDayView}from'../../chunk-
|
|
1
|
+
export{a as CalendarDayView}from'../../chunk-SLMHDBWO.js';import'../../chunk-ZVVPUP7V.js';import'../../chunk-MZSV4LNY.js';import'../../chunk-TTKENFBF.js';import'../../chunk-OKSGVAQQ.js';import'../../chunk-EXC2XOL6.js';import'../../chunk-SXGSWVMZ.js';import'../../chunk-6PHXO2YA.js';import'../../chunk-CBFC4QME.js';import'../../chunk-YOLTIAFT.js';import'../../chunk-M6ZI7M3R.js';import'../../chunk-DVDHTP4C.js';import'../../chunk-EIG6CBTQ.js';//# sourceMappingURL=calendar-day-view.js.map
|
|
2
2
|
//# sourceMappingURL=calendar-day-view.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as CalendarMonthView}from'../../chunk-
|
|
1
|
+
export{a as CalendarMonthView}from'../../chunk-BYXTOSM6.js';import'../../chunk-TTKENFBF.js';import'../../chunk-OKSGVAQQ.js';import'../../chunk-EXC2XOL6.js';import'../../chunk-SXGSWVMZ.js';import'../../chunk-6PHXO2YA.js';import'../../chunk-CBFC4QME.js';import'../../chunk-YOLTIAFT.js';import'../../chunk-M6ZI7M3R.js';import'../../chunk-DVDHTP4C.js';import'../../chunk-EIG6CBTQ.js';//# sourceMappingURL=calendar-month-view.js.map
|
|
2
2
|
//# sourceMappingURL=calendar-month-view.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as CalendarViewRenderer}from'../../chunk-
|
|
1
|
+
export{a as CalendarViewRenderer}from'../../chunk-HLWHETF5.js';import'../../chunk-4M3WR2KJ.js';import'../../chunk-SLMHDBWO.js';import'../../chunk-ZVVPUP7V.js';import'../../chunk-MZSV4LNY.js';import'../../chunk-BYXTOSM6.js';import'../../chunk-TTKENFBF.js';import'../../chunk-OKSGVAQQ.js';import'../../chunk-EXC2XOL6.js';import'../../chunk-SXGSWVMZ.js';import'../../chunk-6PHXO2YA.js';import'../../chunk-CBFC4QME.js';import'../../chunk-YOLTIAFT.js';import'../../chunk-M6ZI7M3R.js';import'../../chunk-DVDHTP4C.js';import'../../chunk-EIG6CBTQ.js';//# sourceMappingURL=calendar-view-renderer.js.map
|
|
2
2
|
//# sourceMappingURL=calendar-view-renderer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as CalendarWeekView}from'../../chunk-
|
|
1
|
+
export{a as CalendarWeekView}from'../../chunk-4M3WR2KJ.js';import'../../chunk-ZVVPUP7V.js';import'../../chunk-MZSV4LNY.js';import'../../chunk-TTKENFBF.js';import'../../chunk-OKSGVAQQ.js';import'../../chunk-EXC2XOL6.js';import'../../chunk-SXGSWVMZ.js';import'../../chunk-6PHXO2YA.js';import'../../chunk-CBFC4QME.js';import'../../chunk-YOLTIAFT.js';import'../../chunk-M6ZI7M3R.js';import'../../chunk-DVDHTP4C.js';import'../../chunk-EIG6CBTQ.js';//# sourceMappingURL=calendar-week-view.js.map
|
|
2
2
|
//# sourceMappingURL=calendar-week-view.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as
|
|
1
|
+
export{a as CalendarTodayButton}from'../../chunk-GKILN5HI.js';export{a as CalendarToggleView}from'../../chunk-G6NSC3FL.js';export{a as CalendarViewRenderer}from'../../chunk-HLWHETF5.js';export{a as CalendarWeekView}from'../../chunk-4M3WR2KJ.js';import'../../chunk-SLMHDBWO.js';import'../../chunk-ZVVPUP7V.js';import'../../chunk-MZSV4LNY.js';export{a as CalendarEvent,c as CalendarEventDescription,d as CalendarEventStatus,b as CalendarEventTitle}from'../../chunk-F4DYKYWJ.js';export{a as CalendarHeader}from'../../chunk-4BGTC333.js';export{a as CalendarMonthView}from'../../chunk-BYXTOSM6.js';import'../../chunk-TTKENFBF.js';import'../../chunk-OKSGVAQQ.js';export{a as CalendarNavigator}from'../../chunk-RGKXZJJS.js';import'../../chunk-EXC2XOL6.js';export{a as CalendarRoot,b as useFullCalendar}from'../../chunk-SXGSWVMZ.js';export{a as CalendarBody}from'../../chunk-J4X5RQTR.js';import'../../chunk-2JU3PFV2.js';import'../../chunk-SLAAEXWI.js';import'../../chunk-JGPHBUVM.js';import'../../chunk-2JQVYVAT.js';import'../../chunk-NELCN6E2.js';import'../../chunk-6PHXO2YA.js';import'../../chunk-CBFC4QME.js';import'../../chunk-YOLTIAFT.js';import'../../chunk-M6ZI7M3R.js';import'../../chunk-DVDHTP4C.js';import'../../chunk-EIG6CBTQ.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@ import { I as IconType } from '../icons-C-hGI45d.js';
|
|
|
6
6
|
|
|
7
7
|
declare const selectionBarVariants: (props?: ({
|
|
8
8
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "warning" | "primary" | "secondary" | "neutral" | "success" | "destructive" | "outline" | null | undefined;
|
|
10
10
|
position?: "fixed" | "absolute" | "relative" | "sticky" | null | undefined;
|
|
11
11
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
12
|
interface SelectionAction {
|
|
@@ -4,7 +4,7 @@ import { ComponentProps } from 'react';
|
|
|
4
4
|
import { ClassVariantProps } from '@xjur-ui/util';
|
|
5
5
|
|
|
6
6
|
declare const statusVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "warning" | "neutral" | "success" | "danger" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface StatusProps extends ComponentProps<'div'>, ClassVariantProps<typeof statusVariants> {
|
|
10
10
|
text?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as
|
|
1
|
+
export{a as NextStep,b as PreviousStep}from'../../chunk-TYWCS7GS.js';export{a as Steps}from'../../chunk-X6SOSTUN.js';export{a as StepsNavigation}from'../../chunk-ZPQPJJQJ.js';export{a as StepsRoot}from'../../chunk-F7ANJ4HD.js';export{a as Step}from'../../chunk-FQTUN47L.js';export{a as StepsContext,b as StepsProvider,c as useSteps}from'../../chunk-O3JK6QF6.js';import'../../chunk-M6ZI7M3R.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as
|
|
1
|
+
export{a as TableFooter}from'../../chunk-FUHASFGU.js';export{a as TableHead,b as TableHeadContent}from'../../chunk-AKR2BJRB.js';export{a as TableHeader}from'../../chunk-Q2BZSHS2.js';export{a as TableRow}from'../../chunk-EITO7GZX.js';export{a as TableSort}from'../../chunk-GVKH2BG2.js';export{a as Table}from'../../chunk-7HMMMRDA.js';export{a as TableBody}from'../../chunk-URDL5OKH.js';export{a as TableCell}from'../../chunk-V2FCP4FA.js';import'../../chunk-DVDHTP4C.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import React__default, { ComponentProps } from 'react';
|
|
4
|
+
import { ClassVariantProps } from '@xjur-ui/util';
|
|
5
|
+
import * as Toast from '@radix-ui/react-toast';
|
|
6
|
+
|
|
7
|
+
declare const toastVariants: (props?: ({
|
|
8
|
+
variant?: "error" | "info" | "warning" | "success" | "success-no-border" | "info-no-border" | "warning-no-border" | "error-no-border" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
interface ToastProps extends ComponentProps<typeof Toast.Root>, ClassVariantProps<typeof toastVariants> {
|
|
11
|
+
children?: React__default.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
dismissible?: boolean;
|
|
15
|
+
onDismiss?: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare function ToastComponent({ children, className, description, dismissible, onDismiss, variant, ...props }: ToastProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
interface ToastProviderProps extends ComponentProps<typeof Toast.Provider> {
|
|
19
|
+
children: React__default.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare function ToastProvider({ children, ...props }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
interface ToastViewportProps extends ComponentProps<typeof Toast.Viewport> {
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
declare function ToastViewport({ className, ...props }: ToastViewportProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
export { ToastComponent, type ToastProps, ToastProvider, type ToastProviderProps, ToastViewport, type ToastViewportProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b as b$1}from'../chunk-DVDHTP4C.js';import {a}from'../chunk-EIG6CBTQ.js';import'react';import {cva,cx}from'@xjur-ui/util';import*as e from'@radix-ui/react-toast';import {jsxs,jsx}from'react/jsx-runtime';var w=cva(["group pointer-events-auto relative flex w-full items-center justify-between space-x-4 rounded-md p-4 shadow-lg transition-all","data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)]","data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none","data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out","data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full","data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full"],{variants:{variant:{success:"border-l-[4px] border-success-idle bg-success-alt-idle text-success-idle","success-no-border":"bg-success-alt-idle text-success-idle",info:"border-l-[4px] border-neutral-border bg-neutral-surface text-neutral-idle","info-no-border":"bg-neutral-surface text-neutral-idle",warning:"border-l-[4px] border-warning-idle bg-warning-alt-idle text-warning-idle","warning-no-border":"bg-warning-alt-idle text-warning-idle",error:"border-l-[4px] border-danger-idle bg-danger-alt-idle text-danger-idle","error-no-border":"bg-danger-alt-idle text-danger-idle"}},defaultVariants:{variant:"info"}}),b=cva(["flex-shrink-0"],{variants:{variant:{success:"text-success-idle","success-no-border":"text-success-idle",info:"text-neutral-idle","info-no-border":"text-neutral-idle",warning:"text-warning-idle","warning-no-border":"text-warning-idle",error:"text-danger-idle","error-no-border":"text-danger-idle"}},defaultVariants:{variant:"info"}}),v=cva(["absolute top-2 right-2 rounded-md py-2 opacity-100 transition-opacity focus:opacity-100 focus:ring-2 focus:outline-none"],{variants:{variant:{success:"text-success-idle hover:text-success-idle/80","success-no-border":"text-success-idle hover:text-success-idle/80",info:"text-neutral-idle hover:text-neutral-idle/80","info-no-border":"text-neutral-idle hover:text-neutral-idle/80",warning:"text-warning-idle hover:text-warning-idle/80","warning-no-border":"text-warning-idle hover:text-warning-idle/80",error:"text-danger-idle hover:text-danger-idle/80","error-no-border":"text-danger-idle hover:text-danger-idle/80"}},defaultVariants:{variant:"info"}}),p=cva(["h-4 w-4"],{variants:{variant:{success:"text-success-idle","success-no-border":"text-success-idle",info:"text-neutral-idle","info-no-border":"text-neutral-idle",warning:"text-warning-idle","warning-no-border":"text-warning-idle",error:"text-danger-idle","error-no-border":"text-danger-idle"}},defaultVariants:{variant:"info"}});function N({children:o,className:a$1,description:l,dismissible:x=true,onDismiss:u,variant:r="info",...m}){let f=()=>{switch(r){case "success":return "check";case "warning":return "warning";case "error":return "error";default:return "info"}},g=()=>{u?.();};return jsxs(e.Root,{className:cx(w({variant:r}),a$1),...m,children:[jsxs("div",{className:"flex items-center space-x-3 pl-4",children:[jsx(b$1,{className:cx(b({variant:r}),"text-lg"),name:f()}),jsxs("div",{className:"flex-1",children:[l&&jsx(e.Description,{asChild:true,className:p({variant:r}),children:jsx(a,{size:"sm",variant:"body",children:l})}),o]})]}),x&&jsxs(e.Close,{className:v({variant:r}),onClick:g,children:[jsx(b$1,{className:p({variant:r}),name:"close"}),jsx("span",{className:"sr-only",children:"Fechar"})]})]})}function C({children:o,...a}){return jsxs(e.Provider,{swipeDirection:"right",...a,children:[o,jsx(e.Viewport,{className:"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]"})]})}function R({className:o,...a}){return jsx(e.Viewport,{className:cx("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]",o),...a})}export{N as ToastComponent,C as ToastProvider,R as ToastViewport};//# sourceMappingURL=toast.js.map
|
|
2
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/toast.tsx"],"names":["toastVariants","cva","toastIconVariants","toastCloseVariants","toastCloseIconVariants","ToastComponent","children","className","description","dismissible","onDismiss","variant","props","getIcon","handleDismiss","jsxs","cx","jsx","Icon","Typography","ToastProvider","ToastViewport"],"mappings":"mNAOA,IAAMA,CAAAA,CAAgBC,GAAAA,CACpB,CACE,+H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SAAA,CAAWZ,CAAAA,CAAmB,CAAE,OAAA,CAAAQ,CAAQ,CAAC,CAAA,CACzC,OAAA,CAASG,EAET,QAAA,CAAA,CAAAG,GAAAA,CAACC,GAAAA,CAAA,CAAK,UAAWd,CAAAA,CAAuB,CAAE,QAAAO,CAAQ,CAAC,EAAG,IAAA,CAAK,OAAA,CAAQ,EACnEM,GAAAA,CAAC,MAAA,CAAA,CAAK,UAAU,SAAA,CAAU,QAAA,CAAA,QAAA,CAAM,GAClC,CAAA,CAAA,CAEJ,CAEJ,CAOO,SAASG,CAAAA,CAAc,CAAE,QAAA,CAAAd,EAAU,GAAGM,CAAM,EAAuB,CACxE,OACEG,KAAO,CAAA,CAAA,QAAA,CAAN,CAAe,eAAe,OAAA,CAAS,GAAGH,EACxC,QAAA,CAAA,CAAAN,CAAAA,CACDW,IAAO,CAAA,CAAA,QAAA,CAAN,CAAe,UAAU,mIAAA,CAAoI,CAAA,CAAA,CAChK,CAEJ,CAOO,SAASI,EAAc,CAAE,SAAA,CAAAd,EAAW,GAAGK,CAAM,EAAuB,CACzE,OACEK,IAAO,CAAA,CAAA,QAAA,CAAN,CACC,UAAWD,EAAAA,CACT,mIAAA,CACAT,CACF,CAAA,CACC,GAAGK,EACN,CAEJ","file":"toast.js","sourcesContent":["import type { ComponentProps } from 'react'\nimport React from 'react'\nimport { cva, cx, type ClassVariantProps } from '@xjur-ui/util'\nimport * as Toast from '@radix-ui/react-toast'\nimport { Icon } from './icon'\nimport { Typography } from './typography'\n\nconst toastVariants = cva(\n [\n 'group pointer-events-auto relative flex w-full items-center justify-between space-x-4 rounded-md p-4 shadow-lg transition-all',\n 'data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)]',\n 'data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out',\n 'data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full',\n 'data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full'\n ],\n {\n variants: {\n variant: {\n success:\n 'border-l-[4px] border-success-idle bg-success-alt-idle text-success-idle',\n 'success-no-border': 'bg-success-alt-idle text-success-idle',\n info: 'border-l-[4px] border-neutral-border bg-neutral-surface text-neutral-idle',\n 'info-no-border': 'bg-neutral-surface text-neutral-idle',\n warning:\n 'border-l-[4px] border-warning-idle bg-warning-alt-idle text-warning-idle',\n 'warning-no-border': 'bg-warning-alt-idle text-warning-idle',\n error:\n 'border-l-[4px] border-danger-idle bg-danger-alt-idle text-danger-idle',\n 'error-no-border': 'bg-danger-alt-idle text-danger-idle'\n }\n },\n defaultVariants: {\n variant: 'info'\n }\n }\n)\n\nconst toastIconVariants = cva(['flex-shrink-0'], {\n variants: {\n variant: {\n success: 'text-success-idle',\n 'success-no-border': 'text-success-idle',\n info: 'text-neutral-idle',\n 'info-no-border': 'text-neutral-idle',\n warning: 'text-warning-idle',\n 'warning-no-border': 'text-warning-idle',\n error: 'text-danger-idle',\n 'error-no-border': 'text-danger-idle'\n }\n },\n defaultVariants: {\n variant: 'info'\n }\n})\n\nconst toastCloseVariants = cva(\n [\n 'absolute top-2 right-2 rounded-md py-2 opacity-100 transition-opacity focus:opacity-100 focus:ring-2 focus:outline-none'\n ],\n {\n variants: {\n variant: {\n success: 'text-success-idle hover:text-success-idle/80',\n 'success-no-border': 'text-success-idle hover:text-success-idle/80',\n info: 'text-neutral-idle hover:text-neutral-idle/80',\n 'info-no-border': 'text-neutral-idle hover:text-neutral-idle/80',\n warning: 'text-warning-idle hover:text-warning-idle/80',\n 'warning-no-border': 'text-warning-idle hover:text-warning-idle/80',\n error: 'text-danger-idle hover:text-danger-idle/80',\n 'error-no-border': 'text-danger-idle hover:text-danger-idle/80'\n }\n },\n defaultVariants: {\n variant: 'info'\n }\n }\n)\n\nconst toastCloseIconVariants = cva(['h-4 w-4'], {\n variants: {\n variant: {\n success: 'text-success-idle',\n 'success-no-border': 'text-success-idle',\n info: 'text-neutral-idle',\n 'info-no-border': 'text-neutral-idle',\n warning: 'text-warning-idle',\n 'warning-no-border': 'text-warning-idle',\n error: 'text-danger-idle',\n 'error-no-border': 'text-danger-idle'\n }\n },\n defaultVariants: {\n variant: 'info'\n }\n})\n\nexport interface ToastProps\n extends ComponentProps<typeof Toast.Root>,\n ClassVariantProps<typeof toastVariants> {\n children?: React.ReactNode\n className?: string\n description?: string\n dismissible?: boolean\n onDismiss?: () => void\n}\n\nexport function ToastComponent({\n children,\n className,\n description,\n dismissible = true,\n onDismiss,\n variant = 'info',\n ...props\n}: ToastProps) {\n const getIcon = () => {\n switch (variant) {\n case 'success':\n return 'check'\n case 'warning':\n return 'warning'\n case 'error':\n return 'error'\n default:\n return 'info'\n }\n }\n\n const handleDismiss = () => {\n onDismiss?.()\n }\n\n return (\n <Toast.Root\n className={cx(toastVariants({ variant }), className)}\n {...props}\n >\n <div className=\"flex items-center space-x-3 pl-4\">\n <Icon\n className={cx(toastIconVariants({ variant }), 'text-lg')}\n name={getIcon()}\n />\n <div className=\"flex-1\">\n {description && (\n <Toast.Description\n asChild={true}\n className={toastCloseIconVariants({ variant })}\n >\n <Typography size=\"sm\" variant=\"body\">\n {description}\n </Typography>\n </Toast.Description>\n )}\n {children}\n </div>\n </div>\n {dismissible && (\n <Toast.Close\n className={toastCloseVariants({ variant })}\n onClick={handleDismiss}\n >\n <Icon className={toastCloseIconVariants({ variant })} name=\"close\" />\n <span className=\"sr-only\">Fechar</span>\n </Toast.Close>\n )}\n </Toast.Root>\n )\n}\n\nexport interface ToastProviderProps\n extends ComponentProps<typeof Toast.Provider> {\n children: React.ReactNode\n}\n\nexport function ToastProvider({ children, ...props }: ToastProviderProps) {\n return (\n <Toast.Provider swipeDirection=\"right\" {...props}>\n {children}\n <Toast.Viewport className=\"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]\" />\n </Toast.Provider>\n )\n}\n\nexport interface ToastViewportProps\n extends ComponentProps<typeof Toast.Viewport> {\n className?: string\n}\n\nexport function ToastViewport({ className, ...props }: ToastViewportProps) {\n return (\n <Toast.Viewport\n className={cx(\n 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]',\n className\n )}\n {...props}\n />\n )\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import { ClassVariantProps } from '@xjur-ui/util';
|
|
|
7
7
|
declare const typographyVariants: (props?: ({
|
|
8
8
|
variant?: "label" | "body" | "title" | "headline" | null | undefined;
|
|
9
9
|
size?: "sm" | "md" | "lg" | "sm-2x" | "sm-1x" | null | undefined;
|
|
10
|
-
weight?: "bold" | "
|
|
10
|
+
weight?: "bold" | "normal" | "black" | "medium" | "thin" | "light" | "extraLight" | "semibold" | "extraBold" | null | undefined;
|
|
11
11
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
12
|
interface TypographyProps extends ComponentProps<'base'>, ClassVariantProps<typeof typographyVariants> {
|
|
13
13
|
asChild?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b as b$3,c as c$1,h,l}from'../chunk-2JU3PFV2.js';import {
|
|
1
|
+
import {a}from'../chunk-3L772WC6.js';import {b as b$3,c as c$1,h,l}from'../chunk-2JU3PFV2.js';import {b as b$2,c,g}from'../chunk-3H75F4Y2.js';import'../chunk-PBR7SFWY.js';import'../chunk-JGPHBUVM.js';import'../chunk-2JQVYVAT.js';import'../chunk-CBFC4QME.js';import'../chunk-YOLTIAFT.js';import {b as b$1}from'../chunk-M6ZI7M3R.js';import {b}from'../chunk-DVDHTP4C.js';import'../chunk-EIG6CBTQ.js';import {createContext,useState,useRef,useCallback,useContext}from'react';import {cva,cx}from'@xjur-ui/util';import {jsx,jsxs}from'react/jsx-runtime';var q=createContext(null);function T(){let l=useContext(q);if(!l)throw new Error("Upload components must be used within UploadRoot");return l}function te({children:l,className:n,files:d,onFilesChange:c,accept:m,multiple:o=false,disabled:u=false,maxFiles:b=1,maxSize:x,acceptedFormats:f=[".jpeg",".png",".webp"],...v}){return jsx(q.Provider,{value:{files:d,onFilesChange:c,accept:m,multiple:o,disabled:u,maxFiles:b,maxSize:x,acceptedFormats:f},children:jsx("div",{className:cx("flex flex-col gap-4",n),...v,children:l})})}var ae=cva(["flex flex-col items-center justify-center","relative border-2 border-dashed border-border-layer-2 rounded-lg transition-all duration-200 ease-in-out cursor-pointer","hover:border-border-layer-2 hover:bg-transparent","focus-within:border-primary-idle focus-within:ring-2 focus-within:ring-primary-idle/20","data-[drag-over=true]:border-primary-idle data-[drag-over=true]:bg-primary-alt-idle/10"],{variants:{size:{large:"p-6 min-h-[200px] ",medium:"p-6 min-h-[160px]",small:"p-6 min-h-[130px]",oneLine:"p-4 min-h-[18px]"},showButton:{true:"",false:""},variant:{default:"bg-white",transparent:"bg-transparent",minimal:"bg-white",oneLineWhite:"bg-white",oneLineTransparent:"bg-transparent"}},compoundVariants:[{size:"large",showButton:true},{size:"medium",showButton:true},{size:"small",showButton:true},{variant:"oneLineWhite",showButton:false,className:"items-center flex flex-row justify-center"},{variant:"oneLineTransparent",showButton:false,className:"items-center flex flex-row justify-center"}],defaultVariants:{size:"large",variant:"default",showButton:true}});function re({className:l,size:n="large",showButton:d=true,variant:c="default",showAcceptedFormats:m=true,buttonText:o="Selecionar arquivo",description:u="Clique ou solte os arquivos para fazer o upload",icon:b="upload",...x}){let{onFilesChange:f,accept:v,multiple:r,disabled:a,maxFiles:t,maxSize:F,acceptedFormats:E}=T(),[W,P]=useState(false),w=useRef(null),[U,D]=useState(0),N=useCallback(i=>{let s=i;return t&&t>0&&(s=s.slice(0,t)),F&&(s=s.filter(p=>p.size<=F)),v&&(s=s.filter(p=>{let Q=`.${p.name.split(".").pop()?.toLowerCase()}`;return E?.some(L=>L.startsWith(".")?L===Q:p.type.includes(L))})),s.map(p=>({name:p.name,type:p.type,fileBinary:p,restrict:false}))},[t,F,v,E]),_=useCallback(i=>{i.preventDefault(),i.stopPropagation(),D(s=>s+1),P(true);},[]),K=useCallback(i=>{i.preventDefault(),i.stopPropagation(),D(s=>s-1),U<=1&&P(false);},[U]),$=useCallback(i=>{i.preventDefault(),i.stopPropagation();},[]),G=useCallback(i=>{if(i.preventDefault(),i.stopPropagation(),P(false),D(0),a)return;let s=Array.from(i.dataTransfer.files),p=N(s);p.length>0&&f?.(p);},[a,f,N]),J=useCallback(i=>{if(a)return;let s=Array.from(i.target.files||[]),p=N(s);p.length>0&&f?.(p);},[a,f,N]);return jsxs(M,{...x,"aria-disabled":a,"aria-label":u,className:cx(ae({size:n,showButton:d,variant:c}),l),"data-drag-over":W,fileInputRef:w,onDragEnter:_,onDragLeave:K,onDragOver:$,onDrop:G,children:[jsx("input",{accept:v,className:"hidden",disabled:a,multiple:r,ref:w,type:"file",onChange:J}),jsx(H,{buttonText:o,description:u,icon:b,showAcceptedFormats:m,showButton:d,variant:c||"default",onButtonClick:()=>{!a&&w.current&&w.current.click();}})]})}function ne({children:l,className:n,...d}){return jsx("h3",{className:cx("text-neutral-dark text-lg font-semibold",n),...d,children:l})}function H({description:l="Clique ou solte os arquivos para fazer o upload",icon:n="upload",showAcceptedFormats:d=true,buttonText:c="Selecionar arquivo",showButton:m=true,onButtonClick:o,variant:u="default",className:b$2,...x}){let{acceptedFormats:f}=T(),v=()=>d?jsxs("p",{className:"text-neutral-secondary mt-2 text-sm",children:["Formatos aceitos: ",f?.join(" ")]}):null;return u==="oneLineWhite"||u==="oneLineTransparent"?jsxs("div",{...x,className:cx("flex h-full items-center justify-center gap-4 text-center",b$2),children:[jsx(b,{className:"text-neutral-secondary text-4xl",name:n}),jsx("p",{className:"text-neutral-dark text-base font-medium",children:l}),v()]}):jsxs("div",{...x,className:cx("flex h-full w-full flex-col items-center gap-4 text-center",b$2),children:[jsxs("div",{className:"flex flex-col items-center",children:[jsx(b,{className:"text-neutral-secondary mb-3 text-4xl",name:n}),jsx("p",{className:"text-neutral-dark mb-2 text-base font-medium",children:l}),v()]}),m&&jsx("div",{children:jsx(b$1,{size:"md",variant:"primary",onClick:a=>{a.stopPropagation(),o?.();},children:c})})]})}function M({children:l,fileInputRef:n,...d}){let{disabled:c}=T(),m=useCallback(()=>{!c&&n?.current&&n.current.click();},[c,n]);return jsx("div",{role:"button",tabIndex:c?-1:0,onClick:m,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),m());},...d,children:l})}function oe({fileTypeOptions:l$1=[{value:"document",label:"Documento"},{value:"image",label:"Imagem"},{value:"video",label:"V\xEDdeo"},{value:"audio",label:"\xC1udio"},{value:"other",label:"Outro"}],onUpdateFile:n,onDeleteFile:d,className:c$2,...m}){let{files:o,onFilesChange:u}=T();if(!o||o.length===0)return null;let b$4=(r,a)=>{if(n)n(r,{description:a});else {let t=[...o];t[r]={...t[r],description:a},u?.(t);}},x=(r,a)=>{if(n)n(r,{fileType:a});else {let t=[...o];t[r]={...t[r],fileType:a},u?.(t);}},f=(r,a)=>{if(n)n(r,{restrict:a});else {let t=[...o];t[r]={...t[r],restrict:a},u?.(t);}},v=r=>{if(d)d(r);else {let a=o.filter((t,F)=>F!==r);u?.(a);}};return jsx("div",{className:cx("space-y-2",c$2),...m,children:jsxs("div",{className:"border-border-layer-2 p-4",children:[jsxs("div",{className:"border-border-layer-2 mb-3 flex w-full flex-row items-center justify-between gap-4 border-b pb-2",children:[jsx("div",{className:"w-full",children:jsx("span",{className:"text-sm font-medium text-gray-300",children:"Descri\xE7\xE3o"})}),jsx("div",{className:"w-full",children:jsx("span",{className:"text-sm font-medium text-gray-300",children:"Tipo"})}),jsx("div",{className:"flex justify-end",children:jsx("span",{className:"text-sm font-medium text-gray-300",children:"Restrito"})})]}),jsx("div",{className:"space-y-3",children:o.map((r,a$1)=>jsxs("div",{className:"flex flex-row items-center gap-4 py-3",children:[jsx("div",{className:"flex justify-start",children:jsx(b,{className:"text-neutral-secondary hover:text-neutral-dark cursor-grab",name:"drag_indicator"})}),jsx("div",{className:"w-full",children:jsx(b$2,{children:jsx(c,{children:jsx(g,{placeholder:"Nome do arquivo",value:r.description||r.name,onChange:t=>b$4(a$1,t.target.value)})})})}),jsx("div",{className:"w-full",children:jsxs(b$3,{children:[jsxs(c$1,{className:"flex justify-between",children:[jsx("span",{className:"text-neutral-dark",children:l$1.find(t=>t.value===r.fileType)?.label||"Tipo"}),jsx(b,{className:"text-neutral-secondary",name:"keyboard_arrow_down"})]}),jsx(h,{children:l$1.map(t=>jsx(l,{value:t.value,onSelect:()=>x(a$1,t.value),children:t.label},t.value))})]})}),jsx("div",{className:"flex justify-end",children:jsx(a,{checked:r.restrict||false,onCheckedChange:t=>f(a$1,t)})}),jsx("div",{className:"flex justify-end",children:jsx(b$1,{appearance:"ghost",size:"sm",variant:"destructive",onClick:()=>v(a$1),children:jsx(b,{name:"delete"})})})]},a$1))})]})})}var me={Root:te,Area:re,Title:ne,AreaContent:H,AreaTrigger:M,EditableList:oe};export{oe as EditableFilesList,me as Upload,re as UploadArea,H as UploadAreaContent,M as UploadAreaTrigger,te as UploadRoot,ne as UploadTitle,ae as uploadAreaVariants};//# sourceMappingURL=upload.js.map
|
|
2
2
|
//# sourceMappingURL=upload.js.map
|