@tomny-dev/uzi 0.5.0 → 0.6.0-pr.60.173.1.802e4f7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/dist/components/card/Card.d.ts +7 -5
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/page-container/PageContainer.d.ts +2 -1
- package/dist/components/page-container/PageContainer.d.ts.map +1 -1
- package/dist/components/surface/Surface.d.ts +16 -0
- package/dist/components/surface/Surface.d.ts.map +1 -0
- package/dist/components/toolbar/Toolbar.d.ts +13 -0
- package/dist/components/toolbar/Toolbar.d.ts.map +1 -0
- package/dist/index.cjs +36 -31
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -32
- package/dist/index10.cjs.map +1 -1
- package/dist/index10.js +19 -15
- package/dist/index10.js.map +1 -1
- package/dist/index11.cjs +21 -18
- package/dist/index11.cjs.map +1 -1
- package/dist/index11.js +8 -15
- package/dist/index11.js.map +1 -1
- package/dist/index12.cjs +7 -14
- package/dist/index12.cjs.map +1 -1
- package/dist/index12.js +15 -37
- package/dist/index12.js.map +1 -1
- package/dist/index13.cjs +18 -52
- package/dist/index13.cjs.map +1 -1
- package/dist/index13.js +15 -77
- package/dist/index13.js.map +1 -1
- package/dist/index14.cjs +15 -80
- package/dist/index14.cjs.map +1 -1
- package/dist/index14.js +37 -13
- package/dist/index14.js.map +1 -1
- package/dist/index15.cjs +52 -18
- package/dist/index15.cjs.map +1 -1
- package/dist/index15.js +77 -9
- package/dist/index15.js.map +1 -1
- package/dist/index16.cjs +79 -8
- package/dist/index16.cjs.map +1 -1
- package/dist/index16.js +13 -41
- package/dist/index16.js.map +1 -1
- package/dist/index17.cjs +18 -60
- package/dist/index17.cjs.map +1 -1
- package/dist/index17.js +9 -428
- package/dist/index17.js.map +1 -1
- package/dist/index18.cjs +8 -430
- package/dist/index18.cjs.map +1 -1
- package/dist/index18.js +42 -4
- package/dist/index18.js.map +1 -1
- package/dist/index19.cjs +61 -5
- package/dist/index19.cjs.map +1 -1
- package/dist/index19.js +430 -13
- package/dist/index19.js.map +1 -1
- package/dist/index20.cjs +430 -12
- package/dist/index20.cjs.map +1 -1
- package/dist/index20.js +4 -4
- package/dist/index20.js.map +1 -1
- package/dist/index21.cjs +5 -5
- package/dist/index21.cjs.map +1 -1
- package/dist/index21.js +12 -9
- package/dist/index21.js.map +1 -1
- package/dist/index22.cjs +12 -9
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +4 -4
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +5 -5
- package/dist/index23.cjs.map +1 -1
- package/dist/index23.js +9 -12
- package/dist/index23.js.map +1 -1
- package/dist/index24.cjs +9 -12
- package/dist/index24.cjs.map +1 -1
- package/dist/index24.js +4 -38
- package/dist/index24.js.map +1 -1
- package/dist/index25.cjs +5 -55
- package/dist/index25.cjs.map +1 -1
- package/dist/index25.js +11 -116
- package/dist/index25.js.map +1 -1
- package/dist/index26.cjs +10 -116
- package/dist/index26.cjs.map +1 -1
- package/dist/index26.js +31 -19
- package/dist/index26.js.map +1 -1
- package/dist/index27.cjs +42 -24
- package/dist/index27.cjs.map +1 -1
- package/dist/index27.js +106 -93
- package/dist/index27.js.map +1 -1
- package/dist/index28.cjs +106 -93
- package/dist/index28.cjs.map +1 -1
- package/dist/index28.js +26 -23
- package/dist/index28.js.map +1 -1
- package/dist/index29.cjs +37 -25
- package/dist/index29.cjs.map +1 -1
- package/dist/index29.js +107 -26
- package/dist/index29.js.map +1 -1
- package/dist/index30.cjs +110 -37
- package/dist/index30.cjs.map +1 -1
- package/dist/index30.js +21 -113
- package/dist/index30.js.map +1 -1
- package/dist/index31.cjs +19 -125
- package/dist/index31.cjs.map +1 -1
- package/dist/index31.js +26 -17
- package/dist/index31.js.map +1 -1
- package/dist/index32.cjs +37 -20
- package/dist/index32.cjs.map +1 -1
- package/dist/index32.js +108 -104
- package/dist/index32.js.map +1 -1
- package/dist/index33.cjs +122 -103
- package/dist/index33.cjs.map +1 -1
- package/dist/index33.js +17 -4
- package/dist/index33.js.map +1 -1
- package/dist/index34.cjs +20 -5
- package/dist/index34.cjs.map +1 -1
- package/dist/index34.js +106 -58
- package/dist/index34.js.map +1 -1
- package/dist/index35.cjs +106 -57
- package/dist/index35.cjs.map +1 -1
- package/dist/index35.js +4 -22
- package/dist/index35.js.map +1 -1
- package/dist/index36.cjs +5 -31
- package/dist/index36.cjs.map +1 -1
- package/dist/index36.js +55 -44
- package/dist/index36.js.map +1 -1
- package/dist/index37.cjs +55 -44
- package/dist/index37.cjs.map +1 -1
- package/dist/index37.js +21 -31
- package/dist/index37.js.map +1 -1
- package/dist/index38.cjs +30 -45
- package/dist/index38.cjs.map +1 -1
- package/dist/index38.js +46 -141
- package/dist/index38.js.map +1 -1
- package/dist/index39.cjs +46 -141
- package/dist/index39.cjs.map +1 -1
- package/dist/index39.js +31 -41
- package/dist/index39.js.map +1 -1
- package/dist/index40.cjs +45 -60
- package/dist/index40.cjs.map +1 -1
- package/dist/index40.js +139 -163
- package/dist/index40.js.map +1 -1
- package/dist/index41.cjs +137 -161
- package/dist/index41.cjs.map +1 -1
- package/dist/index41.js +41 -12
- package/dist/index41.js.map +1 -1
- package/dist/index42.cjs +60 -14
- package/dist/index42.cjs.map +1 -1
- package/dist/index42.js +167 -15
- package/dist/index42.js.map +1 -1
- package/dist/index43.cjs +166 -14
- package/dist/index43.cjs.map +1 -1
- package/dist/index43.js +12 -15
- package/dist/index43.js.map +1 -1
- package/dist/index44.cjs +14 -21
- package/dist/index44.cjs.map +1 -1
- package/dist/index44.js +15 -28
- package/dist/index44.js.map +1 -1
- package/dist/index45.cjs +14 -27
- package/dist/index45.cjs.map +1 -1
- package/dist/index45.js +10 -8
- package/dist/index45.js.map +1 -1
- package/dist/index46.cjs +11 -8
- package/dist/index46.cjs.map +1 -1
- package/dist/index46.js +22 -15
- package/dist/index46.js.map +1 -1
- package/dist/index47.cjs +22 -15
- package/dist/index47.cjs.map +1 -1
- package/dist/index47.js +9 -13
- package/dist/index47.js.map +1 -1
- package/dist/index48.cjs +10 -16
- package/dist/index48.cjs.map +1 -1
- package/dist/index48.js +18 -25
- package/dist/index48.js.map +1 -1
- package/dist/index49.cjs +18 -25
- package/dist/index49.cjs.map +1 -1
- package/dist/index49.js +17 -14
- package/dist/index49.js.map +1 -1
- package/dist/index50.cjs +24 -17
- package/dist/index50.cjs.map +1 -1
- package/dist/index50.js +28 -28
- package/dist/index50.js.map +1 -1
- package/dist/index51.cjs +27 -28
- package/dist/index51.cjs.map +1 -1
- package/dist/index51.js +14 -17
- package/dist/index51.js.map +1 -1
- package/dist/index52.cjs +17 -22
- package/dist/index52.cjs.map +1 -1
- package/dist/index52.js +23 -23
- package/dist/index52.js.map +1 -1
- package/dist/index53.cjs +23 -23
- package/dist/index53.cjs.map +1 -1
- package/dist/index53.js +17 -10
- package/dist/index53.js.map +1 -1
- package/dist/index54.cjs +22 -11
- package/dist/index54.cjs.map +1 -1
- package/dist/index54.js +28 -14
- package/dist/index54.js.map +1 -1
- package/dist/index55.cjs +28 -13
- package/dist/index55.cjs.map +1 -1
- package/dist/index55.js +17 -11
- package/dist/index55.js.map +1 -1
- package/dist/index56.cjs +23 -13
- package/dist/index56.cjs.map +1 -1
- package/dist/index56.js +24 -16
- package/dist/index56.js.map +1 -1
- package/dist/index57.cjs +24 -15
- package/dist/index57.cjs.map +1 -1
- package/dist/index57.js +10 -9
- package/dist/index57.js.map +1 -1
- package/dist/index58.cjs +11 -12
- package/dist/index58.cjs.map +1 -1
- package/dist/index58.js +12 -87
- package/dist/index58.js.map +1 -1
- package/dist/index59.cjs +12 -89
- package/dist/index59.cjs.map +1 -1
- package/dist/index59.js +11 -21
- package/dist/index59.js.map +1 -1
- package/dist/index60.cjs +13 -30
- package/dist/index60.cjs.map +1 -1
- package/dist/index60.js +17 -43
- package/dist/index60.js.map +1 -1
- package/dist/index61.cjs +16 -44
- package/dist/index61.cjs.map +1 -1
- package/dist/index61.js +9 -57
- package/dist/index61.js.map +1 -1
- package/dist/index62.cjs +11 -83
- package/dist/index62.cjs.map +1 -1
- package/dist/index62.js +83 -426
- package/dist/index62.js.map +1 -1
- package/dist/index63.cjs +82 -427
- package/dist/index63.cjs.map +1 -1
- package/dist/index63.js +21 -59
- package/dist/index63.js.map +1 -1
- package/dist/index64.cjs +30 -87
- package/dist/index64.cjs.map +1 -1
- package/dist/index64.js +44 -240
- package/dist/index64.js.map +1 -1
- package/dist/index65.cjs +43 -239
- package/dist/index65.cjs.map +1 -1
- package/dist/index65.js +57 -43
- package/dist/index65.js.map +1 -1
- package/dist/index66.cjs +84 -63
- package/dist/index66.cjs.map +1 -1
- package/dist/index66.js +426 -73
- package/dist/index66.js.map +1 -1
- package/dist/index67.cjs +426 -71
- package/dist/index67.cjs.map +1 -1
- package/dist/index67.js +59 -21
- package/dist/index67.js.map +1 -1
- package/dist/index68.cjs +87 -30
- package/dist/index68.cjs.map +1 -1
- package/dist/index68.js +233 -88
- package/dist/index68.js.map +1 -1
- package/dist/index69.cjs +232 -89
- package/dist/index69.cjs.map +1 -1
- package/dist/index69.js +40 -16
- package/dist/index69.js.map +1 -1
- package/dist/index70.cjs +56 -20
- package/dist/index70.cjs.map +1 -1
- package/dist/index70.js +72 -145
- package/dist/index70.js.map +1 -1
- package/dist/index71.cjs +72 -145
- package/dist/index71.cjs.map +1 -1
- package/dist/index71.js +25 -0
- package/dist/index71.js.map +1 -0
- package/dist/index72.cjs +34 -0
- package/dist/index72.cjs.map +1 -0
- package/dist/index72.js +101 -0
- package/dist/index72.js.map +1 -0
- package/dist/index73.cjs +105 -0
- package/dist/index73.cjs.map +1 -0
- package/dist/index73.js +23 -0
- package/dist/index73.js.map +1 -0
- package/dist/index74.cjs +31 -0
- package/dist/index74.cjs.map +1 -0
- package/dist/index74.js +159 -0
- package/dist/index74.js.map +1 -0
- package/dist/index75.cjs +161 -0
- package/dist/index75.cjs.map +1 -0
- package/dist/index8.js.map +1 -1
- package/dist/index9.cjs.map +1 -1
- package/dist/index9.js.map +1 -1
- package/dist/style.css +216 -45
- package/package.json +2 -2
package/dist/index29.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index29.js","names":[],"sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index29.js","names":[],"sources":["../src/components/select/Select.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./select.module.css\";\n\nexport type SelectOption = {\n label: string;\n value: string;\n disabled?: boolean;\n};\n\nexport type SelectProps = {\n options: SelectOption[];\n value: string;\n onChange: (value: string) => void;\n placeholder?: string;\n allowEmptyOption?: boolean;\n fullWidth?: boolean;\n className?: string;\n id?: string;\n name?: string;\n disabled?: boolean;\n required?: boolean;\n autoComplete?: string;\n form?: string;\n title?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n onBlur?: React.FocusEventHandler<HTMLButtonElement>;\n onFocus?: React.FocusEventHandler<HTMLButtonElement>;\n};\n\nconst EMPTY_OPTION_VALUE = \"__uzi_select_empty__\";\n\nexport const Select = React.forwardRef<HTMLButtonElement, SelectProps>(\n (\n {\n options,\n value,\n onChange,\n placeholder,\n allowEmptyOption = false,\n fullWidth = true,\n className,\n id,\n name,\n disabled,\n required,\n autoComplete,\n form,\n title,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n onBlur,\n onFocus,\n },\n ref,\n ) => {\n return (\n <div\n className={cx(\n styles.wrapper,\n fullWidth && styles.wrapperFullWidth,\n className,\n )}\n >\n <SelectPrimitive.Root\n value={value}\n onValueChange={(nextValue: string) =>\n onChange(nextValue === EMPTY_OPTION_VALUE ? \"\" : nextValue)\n }\n name={name}\n disabled={disabled}\n required={required}\n autoComplete={autoComplete}\n form={form}\n >\n <SelectPrimitive.Trigger\n ref={ref}\n id={id}\n className={styles.trigger}\n title={title}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n onBlur={onBlur}\n onFocus={onFocus}\n >\n <SelectPrimitive.Value\n className={styles.value}\n placeholder={placeholder}\n />\n <SelectPrimitive.Icon\n className={styles.chevron}\n aria-hidden=\"true\"\n >\n <svg\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n >\n <path\n d=\"M2 3.5L5 6.5L8 3.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n className={styles.content}\n position=\"popper\"\n sideOffset={4}\n align=\"start\"\n >\n <SelectPrimitive.Viewport className={styles.viewport}>\n {placeholder && allowEmptyOption ? (\n <SelectPrimitive.Item\n value={EMPTY_OPTION_VALUE}\n className={styles.item}\n >\n <span className={styles.indicator}>\n <SelectPrimitive.ItemIndicator>\n <svg\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n className={styles.indicatorIcon}\n >\n <path\n d=\"M3.5 8.5 6.5 11.5 12.5 4.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{placeholder}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ) : null}\n\n {options.map((opt) => (\n <SelectPrimitive.Item\n key={opt.value}\n value={opt.value}\n disabled={opt.disabled}\n className={styles.item}\n >\n <span className={styles.indicator}>\n <SelectPrimitive.ItemIndicator>\n <svg\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n className={styles.indicatorIcon}\n >\n <path\n d=\"M3.5 8.5 6.5 11.5 12.5 4.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{opt.label}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ))}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n </div>\n );\n },\n);\n\nSelect.displayName = \"Select\";\n"],"mappings":";;;;;;;AAkCA,IAAM,qBAAqB;AAE3B,IAAa,SAAS,MAAM,YAExB,EACE,SACA,OACA,UACA,aACA,mBAAmB,OACnB,YAAY,MACZ,WACA,IACA,MACA,UACA,UACA,cACA,MACA,OACA,cAAc,WACd,mBAAmB,gBACnB,QACA,WAEF,QACG;CACH,OACE,oBAAC,OAAD;EACE,WAAW,GACT,sBAAO,SACP,aAAa,sBAAO,kBACpB,SACF;YAEA,qBAAC,gBAAgB,MAAjB;GACS;GACP,gBAAgB,cACd,SAAS,cAAc,qBAAqB,KAAK,SAAS;GAEtD;GACI;GACA;GACI;GACR;aATR,CAWE,qBAAC,gBAAgB,SAAjB;IACO;IACD;IACJ,WAAW,sBAAO;IACX;IACP,cAAY;IACZ,mBAAiB;IACT;IACC;cARX,CAUE,oBAAC,gBAAgB,OAAjB;KACE,WAAW,sBAAO;KACL;IACd,CAAA,GACD,oBAAC,gBAAgB,MAAjB;KACE,WAAW,sBAAO;KAClB,eAAY;eAEZ,oBAAC,OAAD;MACE,SAAQ;MACR,MAAK;MACL,OAAM;MACN,OAAM;MACN,QAAO;gBAEP,oBAAC,QAAD;OACE,GAAE;OACF,QAAO;OACP,aAAY;OACZ,eAAc;OACd,gBAAe;MAChB,CAAA;KACE,CAAA;IACe,CAAA,CACC;OAEzB,oBAAC,gBAAgB,QAAjB,EAAA,UACE,oBAAC,gBAAgB,SAAjB;IACE,WAAW,sBAAO;IACl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
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
const require_runtime = require("./index2.cjs");
|
|
3
|
+
const require_cx = require("./index4.cjs");
|
|
4
|
+
const require_select_module = require("./index29.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_runtime.__toESM(react, 1);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let _radix_ui_react_select = require("@radix-ui/react-select");
|
|
9
|
+
_radix_ui_react_select = require_runtime.__toESM(_radix_ui_react_select, 1);
|
|
10
|
+
//#region src/components/select/Select.tsx
|
|
11
|
+
var EMPTY_OPTION_VALUE = "__uzi_select_empty__";
|
|
12
|
+
var Select = react.forwardRef(({ options, value, onChange, placeholder, allowEmptyOption = false, fullWidth = true, className, id, name, disabled, required, autoComplete, form, title, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onBlur, onFocus }, ref) => {
|
|
13
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
14
|
+
className: require_cx.cx(require_select_module.default.wrapper, fullWidth && require_select_module.default.wrapperFullWidth, className),
|
|
15
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Root, {
|
|
16
|
+
value,
|
|
17
|
+
onValueChange: (nextValue) => onChange(nextValue === EMPTY_OPTION_VALUE ? "" : nextValue),
|
|
18
|
+
name,
|
|
19
|
+
disabled,
|
|
20
|
+
required,
|
|
21
|
+
autoComplete,
|
|
22
|
+
form,
|
|
23
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Trigger, {
|
|
24
|
+
ref,
|
|
25
|
+
id,
|
|
26
|
+
className: require_select_module.default.trigger,
|
|
27
|
+
title,
|
|
28
|
+
"aria-label": ariaLabel,
|
|
29
|
+
"aria-labelledby": ariaLabelledBy,
|
|
30
|
+
onBlur,
|
|
31
|
+
onFocus,
|
|
32
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Value, {
|
|
33
|
+
className: require_select_module.default.value,
|
|
34
|
+
placeholder
|
|
35
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Icon, {
|
|
36
|
+
className: require_select_module.default.chevron,
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
39
|
+
viewBox: "0 0 10 10",
|
|
40
|
+
fill: "none",
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
+
width: "10",
|
|
43
|
+
height: "10",
|
|
44
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
45
|
+
d: "M2 3.5L5 6.5L8 3.5",
|
|
46
|
+
stroke: "currentColor",
|
|
47
|
+
strokeWidth: "1.5",
|
|
48
|
+
strokeLinecap: "round",
|
|
49
|
+
strokeLinejoin: "round"
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
})]
|
|
53
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Content, {
|
|
54
|
+
className: require_select_module.default.content,
|
|
55
|
+
position: "popper",
|
|
56
|
+
sideOffset: 4,
|
|
57
|
+
align: "start",
|
|
58
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Viewport, {
|
|
59
|
+
className: require_select_module.default.viewport,
|
|
60
|
+
children: [placeholder && allowEmptyOption ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Item, {
|
|
61
|
+
value: EMPTY_OPTION_VALUE,
|
|
62
|
+
className: require_select_module.default.item,
|
|
63
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
64
|
+
className: require_select_module.default.indicator,
|
|
65
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
66
|
+
viewBox: "0 0 16 16",
|
|
67
|
+
width: "16",
|
|
68
|
+
height: "16",
|
|
69
|
+
"aria-hidden": "true",
|
|
70
|
+
className: require_select_module.default.indicatorIcon,
|
|
71
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
72
|
+
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
73
|
+
fill: "none",
|
|
74
|
+
stroke: "currentColor",
|
|
75
|
+
strokeWidth: "1.8",
|
|
76
|
+
strokeLinecap: "round",
|
|
77
|
+
strokeLinejoin: "round"
|
|
78
|
+
})
|
|
79
|
+
}) })
|
|
80
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemText, { children: placeholder })]
|
|
81
|
+
}) : null, options.map((opt) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Item, {
|
|
82
|
+
value: opt.value,
|
|
83
|
+
disabled: opt.disabled,
|
|
84
|
+
className: require_select_module.default.item,
|
|
85
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
86
|
+
className: require_select_module.default.indicator,
|
|
87
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
88
|
+
viewBox: "0 0 16 16",
|
|
89
|
+
width: "16",
|
|
90
|
+
height: "16",
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
className: require_select_module.default.indicatorIcon,
|
|
93
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
94
|
+
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
95
|
+
fill: "none",
|
|
96
|
+
stroke: "currentColor",
|
|
97
|
+
strokeWidth: "1.8",
|
|
98
|
+
strokeLinecap: "round",
|
|
99
|
+
strokeLinejoin: "round"
|
|
100
|
+
})
|
|
101
|
+
}) })
|
|
102
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemText, { children: opt.label })]
|
|
103
|
+
}, opt.value))]
|
|
104
|
+
})
|
|
105
|
+
}) })]
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
Select.displayName = "Select";
|
|
26
110
|
//#endregion
|
|
27
|
-
exports.
|
|
28
|
-
exports.content = content;
|
|
29
|
-
exports.default = dropdown_menu_module_default;
|
|
30
|
-
exports.indicator = indicator;
|
|
31
|
-
exports.indicatorIcon = indicatorIcon;
|
|
32
|
-
exports.insetItem = insetItem;
|
|
33
|
-
exports.item = item;
|
|
34
|
-
exports.itemDestructive = itemDestructive;
|
|
35
|
-
exports.label = label;
|
|
36
|
-
exports.menuFadeIn = menuFadeIn;
|
|
37
|
-
exports.radioDot = radioDot;
|
|
38
|
-
exports.separator = separator;
|
|
111
|
+
exports.Select = Select;
|
|
39
112
|
|
|
40
113
|
//# sourceMappingURL=index30.cjs.map
|
package/dist/index30.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index30.cjs","names":[],"sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index30.cjs","names":[],"sources":["../src/components/select/Select.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./select.module.css\";\n\nexport type SelectOption = {\n label: string;\n value: string;\n disabled?: boolean;\n};\n\nexport type SelectProps = {\n options: SelectOption[];\n value: string;\n onChange: (value: string) => void;\n placeholder?: string;\n allowEmptyOption?: boolean;\n fullWidth?: boolean;\n className?: string;\n id?: string;\n name?: string;\n disabled?: boolean;\n required?: boolean;\n autoComplete?: string;\n form?: string;\n title?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n onBlur?: React.FocusEventHandler<HTMLButtonElement>;\n onFocus?: React.FocusEventHandler<HTMLButtonElement>;\n};\n\nconst EMPTY_OPTION_VALUE = \"__uzi_select_empty__\";\n\nexport const Select = React.forwardRef<HTMLButtonElement, SelectProps>(\n (\n {\n options,\n value,\n onChange,\n placeholder,\n allowEmptyOption = false,\n fullWidth = true,\n className,\n id,\n name,\n disabled,\n required,\n autoComplete,\n form,\n title,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n onBlur,\n onFocus,\n },\n ref,\n ) => {\n return (\n <div\n className={cx(\n styles.wrapper,\n fullWidth && styles.wrapperFullWidth,\n className,\n )}\n >\n <SelectPrimitive.Root\n value={value}\n onValueChange={(nextValue: string) =>\n onChange(nextValue === EMPTY_OPTION_VALUE ? \"\" : nextValue)\n }\n name={name}\n disabled={disabled}\n required={required}\n autoComplete={autoComplete}\n form={form}\n >\n <SelectPrimitive.Trigger\n ref={ref}\n id={id}\n className={styles.trigger}\n title={title}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n onBlur={onBlur}\n onFocus={onFocus}\n >\n <SelectPrimitive.Value\n className={styles.value}\n placeholder={placeholder}\n />\n <SelectPrimitive.Icon\n className={styles.chevron}\n aria-hidden=\"true\"\n >\n <svg\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n >\n <path\n d=\"M2 3.5L5 6.5L8 3.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n className={styles.content}\n position=\"popper\"\n sideOffset={4}\n align=\"start\"\n >\n <SelectPrimitive.Viewport className={styles.viewport}>\n {placeholder && allowEmptyOption ? (\n <SelectPrimitive.Item\n value={EMPTY_OPTION_VALUE}\n className={styles.item}\n >\n <span className={styles.indicator}>\n <SelectPrimitive.ItemIndicator>\n <svg\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n className={styles.indicatorIcon}\n >\n <path\n d=\"M3.5 8.5 6.5 11.5 12.5 4.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{placeholder}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ) : null}\n\n {options.map((opt) => (\n <SelectPrimitive.Item\n key={opt.value}\n value={opt.value}\n disabled={opt.disabled}\n className={styles.item}\n >\n <span className={styles.indicator}>\n <SelectPrimitive.ItemIndicator>\n <svg\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n className={styles.indicatorIcon}\n >\n <path\n d=\"M3.5 8.5 6.5 11.5 12.5 4.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{opt.label}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ))}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n </div>\n );\n },\n);\n\nSelect.displayName = \"Select\";\n"],"mappings":";;;;;;;;;;AAkCA,IAAM,qBAAqB;AAE3B,IAAa,SAAS,MAAM,YAExB,EACE,SACA,OACA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ACvB,CACuB;;GACH,CAAA,EACH,CAAA,CACJ;;CACnB,CAAA;AAET,CACF;AAEA,OAAO,cAAc"}
|
package/dist/index30.js
CHANGED
|
@@ -1,118 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "react";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function DropdownMenuSub(props) {
|
|
21
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { ...props });
|
|
22
|
-
}
|
|
23
|
-
function DropdownMenuRadioGroup(props) {
|
|
24
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.RadioGroup, { ...props });
|
|
25
|
-
}
|
|
26
|
-
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
27
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, {
|
|
28
|
-
sideOffset,
|
|
29
|
-
className: cx(dropdown_menu_module_default.content, className),
|
|
30
|
-
...props
|
|
31
|
-
}) });
|
|
32
|
-
}
|
|
33
|
-
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
34
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, {
|
|
35
|
-
"data-inset": inset ? "true" : void 0,
|
|
36
|
-
className: cx(dropdown_menu_module_default.item, variant === "destructive" && dropdown_menu_module_default.itemDestructive, className),
|
|
37
|
-
...props
|
|
2
|
+
import { Select } from "./index29.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/dropdown/Dropdown.tsx
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use Select for value selection and DropdownMenu for action menus.
|
|
8
|
+
* Dropdown remains as a compatibility alias during migration.
|
|
9
|
+
*/
|
|
10
|
+
var Dropdown = React.forwardRef(({ options, value, onChange, placeholder = "All", allowClear = true, ...rest }, ref) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(Select, {
|
|
12
|
+
ref,
|
|
13
|
+
options,
|
|
14
|
+
value,
|
|
15
|
+
onChange,
|
|
16
|
+
placeholder,
|
|
17
|
+
allowEmptyOption: allowClear,
|
|
18
|
+
fullWidth: false,
|
|
19
|
+
...rest
|
|
38
20
|
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.CheckboxItem, {
|
|
42
|
-
className: cx(dropdown_menu_module_default.item, dropdown_menu_module_default.insetItem, className),
|
|
43
|
-
...props,
|
|
44
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
45
|
-
className: dropdown_menu_module_default.indicator,
|
|
46
|
-
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx("svg", {
|
|
47
|
-
viewBox: "0 0 16 16",
|
|
48
|
-
width: "16",
|
|
49
|
-
height: "16",
|
|
50
|
-
"aria-hidden": "true",
|
|
51
|
-
className: dropdown_menu_module_default.indicatorIcon,
|
|
52
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
53
|
-
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
54
|
-
fill: "none",
|
|
55
|
-
stroke: "currentColor",
|
|
56
|
-
strokeWidth: "1.8",
|
|
57
|
-
strokeLinecap: "round",
|
|
58
|
-
strokeLinejoin: "round"
|
|
59
|
-
})
|
|
60
|
-
}) })
|
|
61
|
-
}), children]
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
65
|
-
return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.RadioItem, {
|
|
66
|
-
className: cx(dropdown_menu_module_default.item, dropdown_menu_module_default.insetItem, className),
|
|
67
|
-
...props,
|
|
68
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
69
|
-
className: dropdown_menu_module_default.indicator,
|
|
70
|
-
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx("span", { className: dropdown_menu_module_default.radioDot }) })
|
|
71
|
-
}), children]
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
75
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Label, {
|
|
76
|
-
"data-inset": inset ? "true" : void 0,
|
|
77
|
-
className: cx(dropdown_menu_module_default.label, className),
|
|
78
|
-
...props
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
function DropdownMenuSeparator({ className, ...props }) {
|
|
82
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, {
|
|
83
|
-
className: cx(dropdown_menu_module_default.separator, className),
|
|
84
|
-
...props
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
88
|
-
return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.SubTrigger, {
|
|
89
|
-
"data-inset": inset ? "true" : void 0,
|
|
90
|
-
className: cx(dropdown_menu_module_default.item, className),
|
|
91
|
-
...props,
|
|
92
|
-
children: [children, /* @__PURE__ */ jsx("svg", {
|
|
93
|
-
viewBox: "0 0 16 16",
|
|
94
|
-
width: "16",
|
|
95
|
-
height: "16",
|
|
96
|
-
"aria-hidden": "true",
|
|
97
|
-
className: dropdown_menu_module_default.chevron,
|
|
98
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
99
|
-
d: "M6 3.5 10.5 8 6 12.5",
|
|
100
|
-
fill: "none",
|
|
101
|
-
stroke: "currentColor",
|
|
102
|
-
strokeWidth: "1.6",
|
|
103
|
-
strokeLinecap: "round",
|
|
104
|
-
strokeLinejoin: "round"
|
|
105
|
-
})
|
|
106
|
-
})]
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function DropdownMenuSubContent({ className, ...props }) {
|
|
110
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubContent, {
|
|
111
|
-
className: cx(dropdown_menu_module_default.content, className),
|
|
112
|
-
...props
|
|
113
|
-
});
|
|
114
|
-
}
|
|
21
|
+
});
|
|
22
|
+
Dropdown.displayName = "Dropdown";
|
|
115
23
|
//#endregion
|
|
116
|
-
export {
|
|
24
|
+
export { Dropdown };
|
|
117
25
|
|
|
118
26
|
//# sourceMappingURL=index30.js.map
|
package/dist/index30.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index30.js","names":[],"sources":["../src/components/dropdown
|
|
1
|
+
{"version":3,"file":"index30.js","names":[],"sources":["../src/components/dropdown/Dropdown.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Select, type SelectOption, type SelectProps } from \"../select/Select\";\n\nexport interface DropdownOption extends SelectOption {}\n\nexport interface DropdownProps\n extends Omit<\n SelectProps,\n \"allowEmptyOption\" | \"fullWidth\" | \"placeholder\" | \"options\"\n > {\n /** List of options to display in the menu. */\n options: DropdownOption[];\n /** Label shown when no option is selected. Defaults to \"All\". */\n placeholder?: string;\n /** Whether to show the placeholder as a clearable option. Defaults to true. */\n allowClear?: boolean;\n}\n\n/**\n * @deprecated Use Select for value selection and DropdownMenu for action menus.\n * Dropdown remains as a compatibility alias during migration.\n */\nexport const Dropdown = React.forwardRef<HTMLButtonElement, DropdownProps>(\n (\n {\n options,\n value,\n onChange,\n placeholder = \"All\",\n allowClear = true,\n ...rest\n },\n ref,\n ) => {\n return (\n <Select\n ref={ref}\n options={options}\n value={value}\n onChange={onChange}\n placeholder={placeholder}\n allowEmptyOption={allowClear}\n fullWidth={false}\n {...rest}\n />\n );\n },\n);\n\nDropdown.displayName = \"Dropdown\";\n"],"mappings":";;;;;;;;;AAwBA,IAAa,WAAW,MAAM,YAE1B,EACE,SACA,OACA,UACA,cAAc,OACd,aAAa,MACb,GAAG,QAEL,QACG;CACH,OACE,oBAAC,QAAD;EACO;EACI;EACF;EACG;EACG;EACb,kBAAkB;EAClB,WAAW;EACX,GAAI;CACL,CAAA;AAEL,CACF;AAEA,SAAS,cAAc"}
|
package/dist/index31.cjs
CHANGED
|
@@ -1,134 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_runtime = require("./index2.cjs");
|
|
3
|
-
const
|
|
4
|
-
const require_dropdown_menu_module = require("./index30.cjs");
|
|
3
|
+
const require_Select = require("./index30.cjs");
|
|
5
4
|
let react = require("react");
|
|
6
5
|
react = require_runtime.__toESM(react, 1);
|
|
7
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function DropdownMenuSub(props) {
|
|
24
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Sub, { ...props });
|
|
25
|
-
}
|
|
26
|
-
function DropdownMenuRadioGroup(props) {
|
|
27
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.RadioGroup, { ...props });
|
|
28
|
-
}
|
|
29
|
-
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
30
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Content, {
|
|
31
|
-
sideOffset,
|
|
32
|
-
className: require_cx.cx(require_dropdown_menu_module.default.content, className),
|
|
33
|
-
...props
|
|
34
|
-
}) });
|
|
35
|
-
}
|
|
36
|
-
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
37
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Item, {
|
|
38
|
-
"data-inset": inset ? "true" : void 0,
|
|
39
|
-
className: require_cx.cx(require_dropdown_menu_module.default.item, variant === "destructive" && require_dropdown_menu_module.default.itemDestructive, className),
|
|
40
|
-
...props
|
|
7
|
+
//#region src/components/dropdown/Dropdown.tsx
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use Select for value selection and DropdownMenu for action menus.
|
|
10
|
+
* Dropdown remains as a compatibility alias during migration.
|
|
11
|
+
*/
|
|
12
|
+
var Dropdown = react.forwardRef(({ options, value, onChange, placeholder = "All", allowClear = true, ...rest }, ref) => {
|
|
13
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Select.Select, {
|
|
14
|
+
ref,
|
|
15
|
+
options,
|
|
16
|
+
value,
|
|
17
|
+
onChange,
|
|
18
|
+
placeholder,
|
|
19
|
+
allowEmptyOption: allowClear,
|
|
20
|
+
fullWidth: false,
|
|
21
|
+
...rest
|
|
41
22
|
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.CheckboxItem, {
|
|
45
|
-
className: require_cx.cx(require_dropdown_menu_module.default.item, require_dropdown_menu_module.default.insetItem, className),
|
|
46
|
-
...props,
|
|
47
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48
|
-
className: require_dropdown_menu_module.default.indicator,
|
|
49
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
50
|
-
viewBox: "0 0 16 16",
|
|
51
|
-
width: "16",
|
|
52
|
-
height: "16",
|
|
53
|
-
"aria-hidden": "true",
|
|
54
|
-
className: require_dropdown_menu_module.default.indicatorIcon,
|
|
55
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
56
|
-
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
57
|
-
fill: "none",
|
|
58
|
-
stroke: "currentColor",
|
|
59
|
-
strokeWidth: "1.8",
|
|
60
|
-
strokeLinecap: "round",
|
|
61
|
-
strokeLinejoin: "round"
|
|
62
|
-
})
|
|
63
|
-
}) })
|
|
64
|
-
}), children]
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
68
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.RadioItem, {
|
|
69
|
-
className: require_cx.cx(require_dropdown_menu_module.default.item, require_dropdown_menu_module.default.insetItem, className),
|
|
70
|
-
...props,
|
|
71
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
72
|
-
className: require_dropdown_menu_module.default.indicator,
|
|
73
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_dropdown_menu_module.default.radioDot }) })
|
|
74
|
-
}), children]
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
78
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Label, {
|
|
79
|
-
"data-inset": inset ? "true" : void 0,
|
|
80
|
-
className: require_cx.cx(require_dropdown_menu_module.default.label, className),
|
|
81
|
-
...props
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
function DropdownMenuSeparator({ className, ...props }) {
|
|
85
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Separator, {
|
|
86
|
-
className: require_cx.cx(require_dropdown_menu_module.default.separator, className),
|
|
87
|
-
...props
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
91
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.SubTrigger, {
|
|
92
|
-
"data-inset": inset ? "true" : void 0,
|
|
93
|
-
className: require_cx.cx(require_dropdown_menu_module.default.item, className),
|
|
94
|
-
...props,
|
|
95
|
-
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
96
|
-
viewBox: "0 0 16 16",
|
|
97
|
-
width: "16",
|
|
98
|
-
height: "16",
|
|
99
|
-
"aria-hidden": "true",
|
|
100
|
-
className: require_dropdown_menu_module.default.chevron,
|
|
101
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
102
|
-
d: "M6 3.5 10.5 8 6 12.5",
|
|
103
|
-
fill: "none",
|
|
104
|
-
stroke: "currentColor",
|
|
105
|
-
strokeWidth: "1.6",
|
|
106
|
-
strokeLinecap: "round",
|
|
107
|
-
strokeLinejoin: "round"
|
|
108
|
-
})
|
|
109
|
-
})]
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
function DropdownMenuSubContent({ className, ...props }) {
|
|
113
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.SubContent, {
|
|
114
|
-
className: require_cx.cx(require_dropdown_menu_module.default.content, className),
|
|
115
|
-
...props
|
|
116
|
-
});
|
|
117
|
-
}
|
|
23
|
+
});
|
|
24
|
+
Dropdown.displayName = "Dropdown";
|
|
118
25
|
//#endregion
|
|
119
|
-
exports.
|
|
120
|
-
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
121
|
-
exports.DropdownMenuContent = DropdownMenuContent;
|
|
122
|
-
exports.DropdownMenuGroup = DropdownMenuGroup;
|
|
123
|
-
exports.DropdownMenuItem = DropdownMenuItem;
|
|
124
|
-
exports.DropdownMenuLabel = DropdownMenuLabel;
|
|
125
|
-
exports.DropdownMenuPortal = DropdownMenuPortal;
|
|
126
|
-
exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
|
|
127
|
-
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
|
|
128
|
-
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
129
|
-
exports.DropdownMenuSub = DropdownMenuSub;
|
|
130
|
-
exports.DropdownMenuSubContent = DropdownMenuSubContent;
|
|
131
|
-
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
|
|
132
|
-
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
26
|
+
exports.Dropdown = Dropdown;
|
|
133
27
|
|
|
134
28
|
//# sourceMappingURL=index31.cjs.map
|
package/dist/index31.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index31.cjs","names":[],"sources":["../src/components/dropdown
|
|
1
|
+
{"version":3,"file":"index31.cjs","names":[],"sources":["../src/components/dropdown/Dropdown.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Select, type SelectOption, type SelectProps } from \"../select/Select\";\n\nexport interface DropdownOption extends SelectOption {}\n\nexport interface DropdownProps\n extends Omit<\n SelectProps,\n \"allowEmptyOption\" | \"fullWidth\" | \"placeholder\" | \"options\"\n > {\n /** List of options to display in the menu. */\n options: DropdownOption[];\n /** Label shown when no option is selected. Defaults to \"All\". */\n placeholder?: string;\n /** Whether to show the placeholder as a clearable option. Defaults to true. */\n allowClear?: boolean;\n}\n\n/**\n * @deprecated Use Select for value selection and DropdownMenu for action menus.\n * Dropdown remains as a compatibility alias during migration.\n */\nexport const Dropdown = React.forwardRef<HTMLButtonElement, DropdownProps>(\n (\n {\n options,\n value,\n onChange,\n placeholder = \"All\",\n allowClear = true,\n ...rest\n },\n ref,\n ) => {\n return (\n <Select\n ref={ref}\n options={options}\n value={value}\n onChange={onChange}\n placeholder={placeholder}\n allowEmptyOption={allowClear}\n fullWidth={false}\n {...rest}\n />\n );\n },\n);\n\nDropdown.displayName = \"Dropdown\";\n"],"mappings":";;;;;;;;;;;AAwBA,IAAa,WAAW,MAAM,YAE1B,EACE,SACA,OACA,UACA,cAAc,OACd,aAAa,MACb,GAAG,QAEL,QACG;CACH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAA,QAAD;EACO;EACI;EACF;EACG;EACG;EACb,kBAAkB;EAClB,WAAW;EACX,GAAI;CACL,CAAA;AAEL,CACF;AAEA,SAAS,cAAc"}
|