@mohirlab/react 0.6.0 → 0.7.0
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/components/accordion/accordion.d.ts +1 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.js +1 -0
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/accordion/accordion.styles.js +1 -0
- package/dist/components/accordion/index.d.ts +1 -0
- package/dist/components/avatar/avatar.css.d.ts +1 -0
- package/dist/components/avatar/avatar.css.d.ts.map +1 -1
- package/dist/components/avatar/avatar.d.ts +1 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +1 -0
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/avatar/avatar.styles.js +1 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/badge/badge.css.d.ts +1 -0
- package/dist/components/badge/badge.css.d.ts.map +1 -1
- package/dist/components/badge/badge.d.ts +1 -0
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +1 -0
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/badge/badge.styles.js +1 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/box/box.d.ts +1 -0
- package/dist/components/box/box.d.ts.map +1 -1
- package/dist/components/box/box.js +1 -0
- package/dist/components/box/box.js.map +1 -1
- package/dist/components/box/index.d.ts +1 -0
- package/dist/components/box/stack.d.ts +1 -0
- package/dist/components/box/stack.d.ts.map +1 -1
- package/dist/components/box/stack.js +1 -0
- package/dist/components/box/stack.js.map +1 -1
- package/dist/components/button/button.css.d.ts +1 -0
- package/dist/components/button/button.css.d.ts.map +1 -1
- package/dist/components/button/button.d.ts +1 -0
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +1 -0
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button/button.styles.js +1 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/card/card-media.d.ts +1 -0
- package/dist/components/card/card-media.d.ts.map +1 -1
- package/dist/components/card/card-media.js +1 -0
- package/dist/components/card/card-media.js.map +1 -1
- package/dist/components/card/card.css.d.ts +1 -0
- package/dist/components/card/card.css.d.ts.map +1 -1
- package/dist/components/card/card.d.ts +1 -0
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +1 -0
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/card/card.styles.js +1 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/choice/choice.d.ts +1 -0
- package/dist/components/choice/choice.d.ts.map +1 -1
- package/dist/components/choice/choice.js +1 -0
- package/dist/components/choice/choice.js.map +1 -1
- package/dist/components/choice/choice.styles.js +1 -0
- package/dist/components/choice/index.d.ts +1 -0
- package/dist/components/combobox/combobox.d.ts +34 -0
- package/dist/components/combobox/combobox.d.ts.map +1 -0
- package/dist/components/combobox/combobox.js +265 -0
- package/dist/components/combobox/combobox.js.map +1 -0
- package/dist/components/combobox/combobox.styles.js +42 -0
- package/dist/components/combobox/combobox.styles.js.map +1 -0
- package/dist/components/combobox/index.d.ts +3 -0
- package/dist/components/dialog/dialog.css.d.ts +1 -0
- package/dist/components/dialog/dialog.css.d.ts.map +1 -1
- package/dist/components/dialog/dialog.d.ts +1 -0
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +1 -0
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/dialog/dialog.styles.js +1 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/feedback/feedback.css.d.ts +39 -0
- package/dist/components/feedback/feedback.css.d.ts.map +1 -0
- package/dist/components/feedback/feedback.d.ts +41 -0
- package/dist/components/feedback/feedback.d.ts.map +1 -0
- package/dist/components/feedback/feedback.js +70 -0
- package/dist/components/feedback/feedback.js.map +1 -0
- package/dist/components/feedback/feedback.styles.js +40 -0
- package/dist/components/feedback/feedback.styles.js.map +1 -0
- package/dist/components/feedback/index.d.ts +3 -0
- package/dist/components/field/field-context.d.ts +1 -0
- package/dist/components/field/field-context.d.ts.map +1 -1
- package/dist/components/field/field-context.js +1 -0
- package/dist/components/field/field-context.js.map +1 -1
- package/dist/components/field/field.d.ts +1 -0
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/field.js +1 -0
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/field/field.styles.js +1 -0
- package/dist/components/field/index.d.ts +1 -0
- package/dist/components/field/use-field-control.js +1 -0
- package/dist/components/field/use-field-control.js.map +1 -1
- package/dist/components/icon/icon.d.ts +1 -0
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +1 -0
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/icon/index.d.ts +1 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/input.css.d.ts +1 -0
- package/dist/components/input/input.css.d.ts.map +1 -1
- package/dist/components/input/input.d.ts +1 -0
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/input/input.js +1 -0
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input/input.styles.js +1 -0
- package/dist/components/menu/index.d.ts +3 -0
- package/dist/components/menu/menu.d.ts +48 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/menu/menu.js +188 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/menu/menu.styles.js +28 -0
- package/dist/components/menu/menu.styles.js.map +1 -0
- package/dist/components/navigation/index.d.ts +3 -1
- package/dist/components/navigation/nav.d.ts +1 -0
- package/dist/components/navigation/nav.d.ts.map +1 -1
- package/dist/components/navigation/nav.js +1 -0
- package/dist/components/navigation/nav.js.map +1 -1
- package/dist/components/navigation/navigation.styles.js +1 -0
- package/dist/components/navigation/pagination.d.ts +34 -0
- package/dist/components/navigation/pagination.d.ts.map +1 -0
- package/dist/components/navigation/pagination.js +109 -0
- package/dist/components/navigation/pagination.js.map +1 -0
- package/dist/components/navigation/pagination.styles.js +11 -0
- package/dist/components/navigation/pagination.styles.js.map +1 -0
- package/dist/components/navigation/tabs.d.ts +1 -0
- package/dist/components/navigation/tabs.d.ts.map +1 -1
- package/dist/components/navigation/tabs.js +1 -0
- package/dist/components/navigation/tabs.js.map +1 -1
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/popover.css.d.ts +1 -0
- package/dist/components/popover/popover.css.d.ts.map +1 -1
- package/dist/components/popover/popover.d.ts +1 -0
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +2 -1
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/popover/popover.styles.js +1 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/select.d.ts +1 -0
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +1 -0
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/select.styles.js +1 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/slider.d.ts +1 -0
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +1 -0
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/slider/slider.styles.js +1 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/table.d.ts +1 -0
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +1 -0
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/table/table.styles.js +1 -0
- package/dist/components/text/index.d.ts +1 -0
- package/dist/components/text/text.css.d.ts +1 -0
- package/dist/components/text/text.css.d.ts.map +1 -1
- package/dist/components/text/text.d.ts +1 -0
- package/dist/components/text/text.d.ts.map +1 -1
- package/dist/components/text/text.js +1 -0
- package/dist/components/text/text.js.map +1 -1
- package/dist/components/text/text.styles.js +1 -0
- package/dist/components/theme-scope/theme-scope.d.ts +1 -0
- package/dist/components/theme-scope/theme-scope.d.ts.map +1 -1
- package/dist/components/theme-scope/theme-scope.js +1 -0
- package/dist/components/theme-scope/theme-scope.js.map +1 -1
- package/dist/components/toast/index.d.ts +1 -0
- package/dist/components/toast/toast.d.ts +1 -0
- package/dist/components/toast/toast.d.ts.map +1 -1
- package/dist/components/toast/toast.js +1 -0
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toast/toast.styles.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +3 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +13 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts.map +1 -0
- package/dist/components/visually-hidden/visually-hidden.js +19 -0
- package/dist/components/visually-hidden/visually-hidden.js.map +1 -0
- package/dist/components/visually-hidden/visually-hidden.styles.js +7 -0
- package/dist/components/visually-hidden/visually-hidden.styles.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-disclosure.d.ts +1 -0
- package/dist/hooks/use-disclosure.d.ts.map +1 -1
- package/dist/hooks/use-disclosure.js +1 -0
- package/dist/hooks/use-disclosure.js.map +1 -1
- package/dist/hooks/use-presence.d.ts +1 -0
- package/dist/hooks/use-presence.d.ts.map +1 -1
- package/dist/hooks/use-presence.js +1 -0
- package/dist/hooks/use-presence.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.js +9 -3
- package/dist/styles.css +640 -166
- package/dist/utils/cx.d.ts +1 -0
- package/dist/utils/cx.d.ts.map +1 -1
- package/dist/utils/cx.js +1 -0
- package/dist/utils/cx.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
// src/components/feedback/feedback.css.ts
|
|
4
|
+
var empty = createRuntimeFn({
|
|
5
|
+
defaultClassName: "ml_5ga6w27",
|
|
6
|
+
variantClassNames: {
|
|
7
|
+
size: {
|
|
8
|
+
sm: "ml_size_sm_5ga6w28",
|
|
9
|
+
md: "ml_size_md_5ga6w29"
|
|
10
|
+
},
|
|
11
|
+
framed: {
|
|
12
|
+
true: "ml_framed_true_5ga6w2a",
|
|
13
|
+
false: "ml_framed_false_5ga6w2b"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
size: "md",
|
|
18
|
+
framed: false
|
|
19
|
+
},
|
|
20
|
+
compoundVariants: []
|
|
21
|
+
});
|
|
22
|
+
var emptyActions = "ml_5ga6w2f";
|
|
23
|
+
var emptyMark = "ml_5ga6w2c";
|
|
24
|
+
var emptyText = "ml_5ga6w2e";
|
|
25
|
+
var emptyTitle = "ml_5ga6w2d";
|
|
26
|
+
var lastLine = "ml_5ga6w26";
|
|
27
|
+
var skeleton = createRuntimeFn({
|
|
28
|
+
defaultClassName: "ml_5ga6w21",
|
|
29
|
+
variantClassNames: { shape: {
|
|
30
|
+
text: "ml_shape_text_5ga6w22",
|
|
31
|
+
circle: "ml_shape_circle_5ga6w23",
|
|
32
|
+
block: "ml_shape_block_5ga6w24"
|
|
33
|
+
} },
|
|
34
|
+
defaultVariants: { shape: "text" },
|
|
35
|
+
compoundVariants: []
|
|
36
|
+
});
|
|
37
|
+
var skeletonLines = "ml_5ga6w25";
|
|
38
|
+
export { empty, emptyActions, emptyMark, emptyText, emptyTitle, lastLine, skeleton, skeletonLines };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=feedback.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.styles.js","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-context.d.ts","names":[],"sources":["../../../src/components/field/field-context.ts"],"mappings":"A,iBAEiB;EACf;EACA;EACA;EACA;EACA;;;qBAMW,gBAAQ"}
|
|
1
|
+
{"version":3,"file":"field-context.d.ts","names":[],"sources":["../../../src/components/field/field-context.ts"],"mappings":";A,iBAEiB;EACf;EACA;EACA;EACA;EACA;;;qBAMW,gBAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-context.js","names":[],"sources":["../../../src/components/field/field-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport interface FieldContextValue {\n id: string;\n describedBy: string | undefined;\n invalid: boolean;\n required: boolean;\n disabled: boolean;\n}\n\nexport const FieldContext = createContext<FieldContextValue | null>(null);\n\n/** Read the surrounding `<Field>`, if any. Controls use it to wire up ARIA. */\nexport const useField = () => useContext(FieldContext);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"field-context.js","names":[],"sources":["../../../src/components/field/field-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport interface FieldContextValue {\n id: string;\n describedBy: string | undefined;\n invalid: boolean;\n required: boolean;\n disabled: boolean;\n}\n\nexport const FieldContext = createContext<FieldContextValue | null>(null);\n\n/** Read the surrounding `<Field>`, if any. Controls use it to wire up ARIA. */\nexport const useField = () => useContext(FieldContext);\n"],"mappings":";;;AAUA,MAAa,eAAe,cAAwC,IAAI;;AAGxE,MAAa,iBAAiB,WAAW,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","names":[],"sources":["../../../src/components/field/field.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"field.d.ts","names":[],"sources":["../../../src/components/field/field.tsx"],"mappings":";;iBAKiB,mBAAmB,KAAK;EACvC,OAAO;;EAEP,OAAO;;EAEP,QAAQ;;EAER;EACA;EACA;;EAEA;;EAEA,gBAAgB;EAChB,UAAU;;wBAGI,QACd,OACA,MACA,OACA,UACA,UACA,UACA,IACA,eACA,WACA,aACG,QACF,6BAAU,IAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","names":["label","hint","error","styles.field","styles.labelRow","styles.label"],"sources":["../../../src/components/field/field.tsx"],"sourcesContent":["import { useId, useMemo, type ComponentPropsWithRef, type ReactNode } from 'react';\nimport { cx } from '../../utils/cx';\nimport { FieldContext } from './field-context';\nimport * as styles from './field.css';\n\nexport interface FieldProps extends Omit<ComponentPropsWithRef<'div'>, 'children'> {\n label: ReactNode;\n /** Help text under the control. Linked with `aria-describedby`. */\n hint?: ReactNode;\n /** Error message. Marks the control `aria-invalid` and replaces nothing: the hint stays. */\n error?: ReactNode;\n /** Shows an \"Optional\" tag. Mohirlab marks optional fields, not required ones. */\n optional?: boolean;\n required?: boolean;\n disabled?: boolean;\n /** Override the generated control id. */\n id?: string;\n /** Text shown for optional fields, for localisation. */\n optionalLabel?: ReactNode;\n children: ReactNode;\n}\n\nexport function Field({\n label,\n hint,\n error,\n optional = false,\n required = false,\n disabled = false,\n id,\n optionalLabel = 'Optional',\n className,\n children,\n ...rest\n}: FieldProps) {\n const generated = useId();\n const controlId = id ?? `ml-field-${generated}`;\n const hintId = hint ? `${controlId}-hint` : undefined;\n const errorId = error ? `${controlId}-error` : undefined;\n const describedBy = [errorId, hintId].filter(Boolean).join(' ') || undefined;\n\n const context = useMemo(\n () => ({ id: controlId, describedBy, invalid: Boolean(error), required, disabled }),\n [controlId, describedBy, error, required, disabled],\n );\n\n return (\n <div {...rest} className={cx(styles.field, className)}>\n <div className={styles.labelRow}>\n <label htmlFor={controlId} className={styles.label}>\n {label}\n </label>\n {optional && <span className={styles.optionalTag}>{optionalLabel}</span>}\n </div>\n <FieldContext.Provider value={context}>{children}</FieldContext.Provider>\n {error && (\n <p id={errorId} className={styles.error}>\n <span className={styles.errorMark} aria-hidden=\"true\" />\n {error}\n </p>\n )}\n {hint && (\n <p id={hintId} className={styles.hint}>\n {hint}\n </p>\n )}\n </div>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"field.js","names":["label","hint","error","styles.field","styles.labelRow","styles.label"],"sources":["../../../src/components/field/field.tsx"],"sourcesContent":["import { useId, useMemo, type ComponentPropsWithRef, type ReactNode } from 'react';\nimport { cx } from '../../utils/cx';\nimport { FieldContext } from './field-context';\nimport * as styles from './field.css';\n\nexport interface FieldProps extends Omit<ComponentPropsWithRef<'div'>, 'children'> {\n label: ReactNode;\n /** Help text under the control. Linked with `aria-describedby`. */\n hint?: ReactNode;\n /** Error message. Marks the control `aria-invalid` and replaces nothing: the hint stays. */\n error?: ReactNode;\n /** Shows an \"Optional\" tag. Mohirlab marks optional fields, not required ones. */\n optional?: boolean;\n required?: boolean;\n disabled?: boolean;\n /** Override the generated control id. */\n id?: string;\n /** Text shown for optional fields, for localisation. */\n optionalLabel?: ReactNode;\n children: ReactNode;\n}\n\nexport function Field({\n label,\n hint,\n error,\n optional = false,\n required = false,\n disabled = false,\n id,\n optionalLabel = 'Optional',\n className,\n children,\n ...rest\n}: FieldProps) {\n const generated = useId();\n const controlId = id ?? `ml-field-${generated}`;\n const hintId = hint ? `${controlId}-hint` : undefined;\n const errorId = error ? `${controlId}-error` : undefined;\n const describedBy = [errorId, hintId].filter(Boolean).join(' ') || undefined;\n\n const context = useMemo(\n () => ({ id: controlId, describedBy, invalid: Boolean(error), required, disabled }),\n [controlId, describedBy, error, required, disabled],\n );\n\n return (\n <div {...rest} className={cx(styles.field, className)}>\n <div className={styles.labelRow}>\n <label htmlFor={controlId} className={styles.label}>\n {label}\n </label>\n {optional && <span className={styles.optionalTag}>{optionalLabel}</span>}\n </div>\n <FieldContext.Provider value={context}>{children}</FieldContext.Provider>\n {error && (\n <p id={errorId} className={styles.error}>\n <span className={styles.errorMark} aria-hidden=\"true\" />\n {error}\n </p>\n )}\n {hint && (\n <p id={hintId} className={styles.hint}>\n {hint}\n </p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAsBA,SAAgB,MAAM,EACpBA,OAAAA,SACAC,MAAAA,QACAC,OAAAA,SACA,WAAW,OACX,WAAW,OACX,WAAW,OACX,IACA,gBAAgB,YAChB,WACA,UACA,GAAG,QACU;CACb,MAAM,YAAY,MAAM;CACxB,MAAM,YAAY,MAAM,YAAY;CACpC,MAAM,SAASD,SAAO,GAAG,UAAU,SAAS,KAAA;CAC5C,MAAM,UAAUC,UAAQ,GAAG,UAAU,UAAU,KAAA;CAC/C,MAAM,cAAc,CAAC,SAAS,MAAM,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;CAEnE,MAAM,UAAU,eACP;EAAE,IAAI;EAAW;EAAa,SAAS,QAAQA,OAAK;EAAG;EAAU;CAAS,IACjF;EAAC;EAAW;EAAaA;EAAO;EAAU;CAAQ,CACpD;CAEA,OACE,qBAAC,OAAD;EAAK,GAAI;EAAM,WAAW,GAAGC,OAAc,SAAS;EAApD,UAAA;GACE,qBAAC,OAAD;IAAK,WAAWC;IAAhB,UAAA,CACE,oBAAC,SAAD;KAAO,SAAS;KAAW,WAAWC;KACnCL,UAAAA;IACI,CAAA,GACN,YAAY,oBAAC,QAAD;KAAM,WAAW;KAAqB,UAAA;IAAoB,CAAA,CACpE;;GACL,oBAAC,aAAa,UAAd;IAAuB,OAAO;IAAU;GAAgC,CAAA;GACvEE,WACC,qBAAC,KAAD;IAAG,IAAI;IAAS,WAAW;IAA3B,UAAA,CACE,oBAAC,QAAD;KAAM,WAAW;KAAkB,eAAY;IAAQ,CAAA,GACtDA,OACA;;GAEJD,UACC,oBAAC,KAAD;IAAG,IAAI;IAAQ,WAAW;IACvBA,UAAAA;GACA,CAAA;EAEF;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-field-control.js","names":[],"sources":["../../../src/components/field/use-field-control.ts"],"sourcesContent":["import { useField } from './field-context';\n\ninterface ControlProps {\n id?: string;\n required?: boolean;\n disabled?: boolean;\n invalid?: boolean;\n 'aria-describedby'?: string;\n}\n\n/**\n * Props a form control takes from the surrounding `<Field>`: id (for the label),\n * required, disabled, invalid state and the hint/error description. Anything set\n * on the control itself wins; descriptions are merged.\n */\nexport function useFieldControl({\n id,\n required,\n disabled,\n invalid,\n 'aria-describedby': describedBy,\n}: ControlProps) {\n const field = useField();\n const isInvalid = invalid ?? field?.invalid ?? false;\n return {\n id: id ?? field?.id,\n required: required ?? field?.required,\n disabled: disabled ?? field?.disabled,\n 'aria-invalid': isInvalid || undefined,\n 'aria-describedby': [field?.describedBy, describedBy].filter(Boolean).join(' ') || undefined,\n } as const;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-field-control.js","names":[],"sources":["../../../src/components/field/use-field-control.ts"],"sourcesContent":["import { useField } from './field-context';\n\ninterface ControlProps {\n id?: string;\n required?: boolean;\n disabled?: boolean;\n invalid?: boolean;\n 'aria-describedby'?: string;\n}\n\n/**\n * Props a form control takes from the surrounding `<Field>`: id (for the label),\n * required, disabled, invalid state and the hint/error description. Anything set\n * on the control itself wins; descriptions are merged.\n */\nexport function useFieldControl({\n id,\n required,\n disabled,\n invalid,\n 'aria-describedby': describedBy,\n}: ControlProps) {\n const field = useField();\n const isInvalid = invalid ?? field?.invalid ?? false;\n return {\n id: id ?? field?.id,\n required: required ?? field?.required,\n disabled: disabled ?? field?.disabled,\n 'aria-invalid': isInvalid || undefined,\n 'aria-describedby': [field?.describedBy, describedBy].filter(Boolean).join(' ') || undefined,\n } as const;\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,gBAAgB,EAC9B,IACA,UACA,UACA,SACA,oBAAoB,eACL;CACf,MAAM,QAAQ,SAAS;CACvB,MAAM,YAAY,WAAW,OAAO,WAAW;CAC/C,OAAO;EACL,IAAI,MAAM,OAAO;EACjB,UAAU,YAAY,OAAO;EAC7B,UAAU,YAAY,OAAO;EAC7B,gBAAgB,aAAa,KAAA;EAC7B,oBAAoB,CAAC,OAAO,aAAa,WAAW,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;CACrF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","names":[],"sources":["../../../src/components/icon/icon.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon.d.ts","names":[],"sources":["../../../src/components/icon/icon.tsx"],"mappings":";;;iBAGiB,kBAAkB,KAAK,SAAS;;EAE/C,MAAM;;EAEN;EACA;;EAEA;;wBAOc,OAAO,MAAM,MAAiB,aAAa,UAAU,QAAQ,4BAAS,IAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","names":[],"sources":["../../../src/components/icon/icon.tsx"],"sourcesContent":["import { createElement, type SVGProps } from 'react';\nimport { defaultAttributes, type IconData } from '@mohirlab/icons';\n\nexport interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'children'> {\n /** Icon data from `@mohirlab/icons`, e.g. `iconHeart`. Import only what you use. */\n icon: IconData;\n /** Pixel size or any CSS length. Default `1.25em`, so icons follow text size. */\n size?: number | string;\n strokeWidth?: number | string;\n /** Accessible name. Without it the icon is decorative and hidden from assistive tech. */\n label?: string;\n}\n\n// SVG attribute names → React prop names, for the few that differ.\nconst reactName = (attr: string) => attr.replace(/-(\\w)/g, (_, c: string) => c.toUpperCase());\nconst defaults = Object.fromEntries(Object.entries(defaultAttributes).map(([k, v]) => [reactName(k), v]));\n\nexport function Icon({ icon, size = '1.25em', strokeWidth, label, ...rest }: IconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n {...defaults}\n {...(strokeWidth === undefined ? {} : { strokeWidth })}\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n focusable=\"false\"\n data-icon={icon.name}\n {...rest}\n >\n {icon.nodes.map(([tag, attrs], i) =>\n createElement(tag, {\n key: i,\n ...Object.fromEntries(Object.entries(attrs).map(([k, v]) => [reactName(k), v])),\n }),\n )}\n </svg>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon.js","names":[],"sources":["../../../src/components/icon/icon.tsx"],"sourcesContent":["import { createElement, type SVGProps } from 'react';\nimport { defaultAttributes, type IconData } from '@mohirlab/icons';\n\nexport interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'children'> {\n /** Icon data from `@mohirlab/icons`, e.g. `iconHeart`. Import only what you use. */\n icon: IconData;\n /** Pixel size or any CSS length. Default `1.25em`, so icons follow text size. */\n size?: number | string;\n strokeWidth?: number | string;\n /** Accessible name. Without it the icon is decorative and hidden from assistive tech. */\n label?: string;\n}\n\n// SVG attribute names → React prop names, for the few that differ.\nconst reactName = (attr: string) => attr.replace(/-(\\w)/g, (_, c: string) => c.toUpperCase());\nconst defaults = Object.fromEntries(Object.entries(defaultAttributes).map(([k, v]) => [reactName(k), v]));\n\nexport function Icon({ icon, size = '1.25em', strokeWidth, label, ...rest }: IconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n {...defaults}\n {...(strokeWidth === undefined ? {} : { strokeWidth })}\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n focusable=\"false\"\n data-icon={icon.name}\n {...rest}\n >\n {icon.nodes.map(([tag, attrs], i) =>\n createElement(tag, {\n key: i,\n ...Object.fromEntries(Object.entries(attrs).map(([k, v]) => [reactName(k), v])),\n }),\n )}\n </svg>\n );\n}\n"],"mappings":";;;;;AAcA,MAAM,aAAa,SAAiB,KAAK,QAAQ,WAAW,GAAG,MAAc,EAAE,YAAY,CAAC;AAC5F,MAAM,WAAW,OAAO,YAAY,OAAO,QAAQ,iBAAiB,CAAC,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAExG,SAAgB,KAAK,EAAE,MAAM,OAAO,UAAU,aAAa,OAAO,GAAG,QAAmB;CACtF,OACE,oBAAC,OAAD;EACE,OAAM;EACN,SAAQ;EACR,OAAO;EACP,QAAQ;EACR,GAAI;EACJ,GAAK,gBAAgB,KAAA,IAAY,CAAC,IAAI,EAAE,YAAY;EACpD,MAAM,QAAQ,QAAQ,KAAA;EACtB,cAAY;EACZ,eAAa,QAAQ,KAAA,IAAY;EACjC,WAAU;EACV,aAAW,KAAK;EAChB,GAAI;EAEH,UAAA,KAAK,MAAM,KAAK,CAAC,KAAK,QAAQ,MAC7B,cAAc,KAAK;GACjB,KAAK;GACL,GAAG,OAAO,YAAY,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;EAChF,CAAC,CACH;CACG,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.css.d.ts","names":[],"sources":["../../../src/components/input/input.css.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"input.css.d.ts","names":[],"sources":["../../../src/components/input/input.css.ts"],"mappings":";;;;;;qBAyBa,0CAAK;;IAqCZ,mCAAE;IAIF,mCAAE;IACF,mCAAE;;;YAMI,gBAAgB,YAAY,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","names":[],"sources":["../../../src/components/input/input.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"input.d.ts","names":[],"sources":["../../../src/components/input/input.tsx"],"mappings":";;;iBAMiB,mBAAmB,KAAK;EACvC,OAAO;;EAEP;;wBAGc,QAAQ,MAAM,SAAS,WAAW,IAAI,UAAU,aAAa,QAAQ,6BAAU,IAAA;iBAW9E,sBAAsB;EACrC;;;;;;EAMA;;EAEA;;wBAGc,WACd,SACA,UACA,MACA,SACA,WACA,OACA,IACA,UACA,aACG,QACF,gCAAa,IAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","names":["maxRows","maxRowsVar"],"sources":["../../../src/components/input/input.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { cx } from '../../utils/cx';\nimport { useFieldControl } from '../field/use-field-control';\nimport { input, maxRows as maxRowsVar, textarea, type InputVariants } from './input.css';\n\nexport interface InputProps extends Omit<ComponentPropsWithRef<'input'>, 'size'> {\n size?: InputVariants['size'];\n /** Mark as invalid. Inside a `<Field error>` this is set for you. */\n invalid?: boolean;\n}\n\nexport function Input({ size, invalid, className, id, required, disabled, ...rest }: InputProps) {\n const control = useFieldControl({\n id,\n required,\n disabled,\n invalid,\n 'aria-describedby': rest['aria-describedby'],\n });\n return <input {...rest} {...control} className={cx(input({ size }), className)} />;\n}\n\nexport interface TextareaProps extends ComponentPropsWithRef<'textarea'> {\n invalid?: boolean;\n /**\n * Grow with the content up to `maxRows`, where the browser supports CSS\n * `field-sizing` (Chrome 123, Safari 26.2, Firefox 152). Elsewhere the user can\n * resize it. Default true.\n */\n autoGrow?: boolean;\n /** Upper bound for auto-grow, in lines. Default 10. */\n maxRows?: number;\n}\n\nexport function Textarea({\n invalid,\n autoGrow = true,\n rows = 3,\n maxRows = 10,\n className,\n style,\n id,\n required,\n disabled,\n ...rest\n}: TextareaProps) {\n const control = useFieldControl({\n id,\n required,\n disabled,\n invalid,\n 'aria-describedby': rest['aria-describedby'],\n });\n return (\n <textarea\n {...rest}\n {...control}\n rows={rows}\n data-autogrow={autoGrow || undefined}\n className={cx(input({ size: 'md' }), textarea, className)}\n style={{ ...style, ...assignInlineVars({ [maxRowsVar]: String(maxRows) }) }}\n />\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"input.js","names":["maxRows","maxRowsVar"],"sources":["../../../src/components/input/input.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { cx } from '../../utils/cx';\nimport { useFieldControl } from '../field/use-field-control';\nimport { input, maxRows as maxRowsVar, textarea, type InputVariants } from './input.css';\n\nexport interface InputProps extends Omit<ComponentPropsWithRef<'input'>, 'size'> {\n size?: InputVariants['size'];\n /** Mark as invalid. Inside a `<Field error>` this is set for you. */\n invalid?: boolean;\n}\n\nexport function Input({ size, invalid, className, id, required, disabled, ...rest }: InputProps) {\n const control = useFieldControl({\n id,\n required,\n disabled,\n invalid,\n 'aria-describedby': rest['aria-describedby'],\n });\n return <input {...rest} {...control} className={cx(input({ size }), className)} />;\n}\n\nexport interface TextareaProps extends ComponentPropsWithRef<'textarea'> {\n invalid?: boolean;\n /**\n * Grow with the content up to `maxRows`, where the browser supports CSS\n * `field-sizing` (Chrome 123, Safari 26.2, Firefox 152). Elsewhere the user can\n * resize it. Default true.\n */\n autoGrow?: boolean;\n /** Upper bound for auto-grow, in lines. Default 10. */\n maxRows?: number;\n}\n\nexport function Textarea({\n invalid,\n autoGrow = true,\n rows = 3,\n maxRows = 10,\n className,\n style,\n id,\n required,\n disabled,\n ...rest\n}: TextareaProps) {\n const control = useFieldControl({\n id,\n required,\n disabled,\n invalid,\n 'aria-describedby': rest['aria-describedby'],\n });\n return (\n <textarea\n {...rest}\n {...control}\n rows={rows}\n data-autogrow={autoGrow || undefined}\n className={cx(input({ size: 'md' }), textarea, className)}\n style={{ ...style, ...assignInlineVars({ [maxRowsVar]: String(maxRows) }) }}\n />\n );\n}\n"],"mappings":";;;;;;;AAYA,SAAgB,MAAM,EAAE,MAAM,SAAS,WAAW,IAAI,UAAU,UAAU,GAAG,QAAoB;CAC/F,MAAM,UAAU,gBAAgB;EAC9B;EACA;EACA;EACA;EACA,oBAAoB,KAAK;CAC3B,CAAC;CACD,OAAO,oBAAC,SAAD;EAAO,GAAI;EAAM,GAAI;EAAS,WAAW,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,SAAS;CAAI,CAAA;AACnF;AAcA,SAAgB,SAAS,EACvB,SACA,WAAW,MACX,OAAO,GACPA,SAAAA,YAAU,IACV,WACA,OACA,IACA,UACA,UACA,GAAG,QACa;CAChB,MAAM,UAAU,gBAAgB;EAC9B;EACA;EACA;EACA;EACA,oBAAoB,KAAK;CAC3B,CAAC;CACD,OACE,oBAAC,YAAD;EACE,GAAI;EACJ,GAAI;EACE;EACN,iBAAe,YAAY,KAAA;EAC3B,WAAW,GAAG,MAAM,EAAE,MAAM,KAAK,CAAC,GAAG,UAAU,SAAS;EACxD,OAAO;GAAE,GAAG;GAAO,GAAG,iBAAiB,GAAGC,UAAa,OAAOD,SAAO,EAAE,CAAC;EAAE;CAC3E,CAAA;AAEL"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
import { CSSProperties, ComponentPropsWithRef, KeyboardEvent, MouseEvent, ReactElement, ReactNode } from "react";
|
|
3
|
+
import { IconData } from "@mohirlab/icons";
|
|
4
|
+
import { Placement } from "../popover/popover.css.js";
|
|
5
|
+
type TriggerProps = {
|
|
6
|
+
id?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
popoverTarget?: string;
|
|
9
|
+
'aria-haspopup'?: 'menu';
|
|
10
|
+
onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
11
|
+
};
|
|
12
|
+
export interface MenuProps extends Omit<ComponentPropsWithRef<'div'>, 'popover'> {
|
|
13
|
+
/** The button that opens it: usually a `Button`. It must be a `<button>`. */
|
|
14
|
+
trigger: ReactElement<TriggerProps>;
|
|
15
|
+
placement?: Placement;
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A list of actions behind a button: "More", row actions, account menus.
|
|
21
|
+
* The Popover API gives light dismiss, Escape and the top layer; the keyboard follows the
|
|
22
|
+
* WAI-ARIA menu button pattern: arrows, Home, End and type-to-find. For choosing a value
|
|
23
|
+
* use `Select` or `Combobox`, and for navigation use links.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Menu({ trigger, placement, onOpenChange, className, style, children, ...rest }: MenuProps): import("react").JSX.Element;
|
|
26
|
+
export interface MenuItemProps extends Omit<ComponentPropsWithRef<'button'>, 'onSelect'> {
|
|
27
|
+
icon?: IconData;
|
|
28
|
+
/** Keyboard shortcut hint, e.g. "⌘D". Display only: wire the shortcut yourself. */
|
|
29
|
+
shortcut?: string;
|
|
30
|
+
/** `danger` for destructive actions such as Delete. */
|
|
31
|
+
tone?: 'neutral' | 'danger';
|
|
32
|
+
/**
|
|
33
|
+
* Called when the item is chosen by click, Enter or Space. The menu then closes;
|
|
34
|
+
* call `event.preventDefault()` to keep it open.
|
|
35
|
+
*/
|
|
36
|
+
onSelect?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
37
|
+
}
|
|
38
|
+
export declare function MenuItem({ icon, shortcut, tone, onSelect, onClick, disabled, className, children, ...rest }: MenuItemProps): import("react").JSX.Element;
|
|
39
|
+
/** A hairline between groups of items. */
|
|
40
|
+
export declare function MenuSeparator({ className, ...rest }: ComponentPropsWithRef<'hr'>): import("react").JSX.Element;
|
|
41
|
+
export interface MenuGroupProps extends ComponentPropsWithRef<'div'> {
|
|
42
|
+
/** A short heading for the group, e.g. "Sort by". */
|
|
43
|
+
label: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/** Related items under a small heading. */
|
|
46
|
+
export declare function MenuGroup({ label, className, children, ...rest }: MenuGroupProps): import("react").JSX.Element;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","names":[],"sources":["../../../src/components/menu/menu.tsx"],"mappings":";;;;KAmBK;EACH;EACA,QAAQ;EACR;EACA;EACA,aAAa,OAAO,cAAc;;iBAOnB,kBAAkB,KAAK;;EAEtC,SAAS,aAAa;EACtB,YAAY;EACZ,gBAAgB;EAChB,UAAU;;;;;;;;wBASI,OACd,SACA,WACA,cACA,WACA,OACA,aACG,QACF,4BAAS,IAAA;iBAiIK,sBAAsB,KAAK;EAC1C,OAAO;;EAEP;;EAEA;;;;;EAKA,YAAY,OAAO,WAAW;;wBAGhB,WACd,MACA,UACA,MACA,UACA,SACA,UACA,WACA,aACG,QACF,gCAAa,IAAA;;wBAgCA,gBAAgB,cAAc,QAAQ,8CAA2B,IAAA;iBAIhE,uBAAuB;;EAEtC,OAAO;;;wBAIO,YAAY,OAAO,WAAW,aAAa,QAAQ,iCAAc,IAAA"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cloneElement, useEffect, useId, useRef } from "react";
|
|
3
|
+
import { cx } from "../../utils/cx.js";
|
|
4
|
+
import { Icon } from "../icon/icon.js";
|
|
5
|
+
import { useAnchorName } from "../popover/popover.js";
|
|
6
|
+
import { groupLabel, item, itemLabel, menu, popover, separator } from "./menu.styles.js";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/components/menu/menu.tsx
|
|
9
|
+
const ITEM = "[role=\"menuitem\"]:not([aria-disabled=\"true\"])";
|
|
10
|
+
const items = (menu) => [...menu.querySelectorAll(ITEM)];
|
|
11
|
+
/**
|
|
12
|
+
* A list of actions behind a button: "More", row actions, account menus.
|
|
13
|
+
* The Popover API gives light dismiss, Escape and the top layer; the keyboard follows the
|
|
14
|
+
* WAI-ARIA menu button pattern: arrows, Home, End and type-to-find. For choosing a value
|
|
15
|
+
* use `Select` or `Combobox`, and for navigation use links.
|
|
16
|
+
*/
|
|
17
|
+
function Menu({ trigger, placement = "bottom-start", onOpenChange, className, style, children, ...rest }) {
|
|
18
|
+
const menuId = useId();
|
|
19
|
+
const triggerId = useId();
|
|
20
|
+
const anchor = useAnchorName();
|
|
21
|
+
const ref = useRef(null);
|
|
22
|
+
/** Which item to focus when the menu opens: first, or last after ArrowUp on the trigger. */
|
|
23
|
+
const focusOnOpen = useRef("first");
|
|
24
|
+
const typed = useRef({
|
|
25
|
+
text: "",
|
|
26
|
+
at: 0
|
|
27
|
+
});
|
|
28
|
+
const onOpenChangeRef = useRef(onOpenChange);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
onOpenChangeRef.current = onOpenChange;
|
|
31
|
+
});
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const menu = ref.current;
|
|
34
|
+
if (!menu) return;
|
|
35
|
+
const onToggle = (event) => {
|
|
36
|
+
const open = event.newState === "open";
|
|
37
|
+
if (open) {
|
|
38
|
+
const list = items(menu);
|
|
39
|
+
(focusOnOpen.current === "last" ? list.at(-1) : list[0])?.focus();
|
|
40
|
+
focusOnOpen.current = "first";
|
|
41
|
+
}
|
|
42
|
+
onOpenChangeRef.current?.(open);
|
|
43
|
+
};
|
|
44
|
+
menu.addEventListener("toggle", onToggle);
|
|
45
|
+
return () => menu.removeEventListener("toggle", onToggle);
|
|
46
|
+
}, []);
|
|
47
|
+
const triggerEl = () => document.getElementById(trigger.props.id ?? triggerId);
|
|
48
|
+
const close = () => {
|
|
49
|
+
const menu = ref.current;
|
|
50
|
+
if (menu?.matches(":popover-open")) menu.hidePopover();
|
|
51
|
+
triggerEl()?.focus();
|
|
52
|
+
};
|
|
53
|
+
const onMenuKeyDown = (event) => {
|
|
54
|
+
const menu = event.currentTarget;
|
|
55
|
+
const list = items(menu);
|
|
56
|
+
const index = list.indexOf(document.activeElement);
|
|
57
|
+
const move = (to) => list[(to + list.length) % list.length]?.focus();
|
|
58
|
+
switch (event.key) {
|
|
59
|
+
case "ArrowDown":
|
|
60
|
+
move(index + 1);
|
|
61
|
+
break;
|
|
62
|
+
case "ArrowUp":
|
|
63
|
+
move(index < 0 ? -1 : index - 1);
|
|
64
|
+
break;
|
|
65
|
+
case "Home":
|
|
66
|
+
move(0);
|
|
67
|
+
break;
|
|
68
|
+
case "End":
|
|
69
|
+
move(-1);
|
|
70
|
+
break;
|
|
71
|
+
case "Escape":
|
|
72
|
+
close();
|
|
73
|
+
break;
|
|
74
|
+
case "Tab":
|
|
75
|
+
menu.hidePopover();
|
|
76
|
+
return;
|
|
77
|
+
default: {
|
|
78
|
+
if (event.key.length !== 1 || event.ctrlKey || event.metaKey || event.altKey) return;
|
|
79
|
+
const now = Date.now();
|
|
80
|
+
typed.current.text = (now - typed.current.at > 500 ? "" : typed.current.text) + event.key.toLowerCase();
|
|
81
|
+
typed.current.at = now;
|
|
82
|
+
const text = typed.current.text;
|
|
83
|
+
const ordered = [...list.slice(index + 1), ...list.slice(0, index + 1)];
|
|
84
|
+
const repeat = text.length > 1 && [...text].every((c) => c === text[0]);
|
|
85
|
+
ordered.find((el) => (el.textContent ?? "").trim().toLowerCase().startsWith(repeat ? text[0] : text))?.focus();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
};
|
|
90
|
+
const props = trigger.props;
|
|
91
|
+
const wiredTrigger = cloneElement(trigger, {
|
|
92
|
+
id: props.id ?? triggerId,
|
|
93
|
+
popoverTarget: menuId,
|
|
94
|
+
"aria-haspopup": "menu",
|
|
95
|
+
style: {
|
|
96
|
+
...props.style,
|
|
97
|
+
anchorName: anchor
|
|
98
|
+
},
|
|
99
|
+
onKeyDown: (event) => {
|
|
100
|
+
props.onKeyDown?.(event);
|
|
101
|
+
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") return;
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
focusOnOpen.current = event.key === "ArrowUp" ? "last" : "first";
|
|
104
|
+
ref.current?.showPopover();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [wiredTrigger, /* @__PURE__ */ jsx("div", {
|
|
108
|
+
...rest,
|
|
109
|
+
ref,
|
|
110
|
+
id: menuId,
|
|
111
|
+
popover: "auto",
|
|
112
|
+
role: "menu",
|
|
113
|
+
"aria-labelledby": props.id ?? triggerId,
|
|
114
|
+
tabIndex: -1,
|
|
115
|
+
className: cx(popover({ placement }), menu, className),
|
|
116
|
+
style: {
|
|
117
|
+
...style,
|
|
118
|
+
positionAnchor: anchor
|
|
119
|
+
},
|
|
120
|
+
onKeyDown: onMenuKeyDown,
|
|
121
|
+
onClick: (event) => {
|
|
122
|
+
const target = event.target.closest("[role=\"menuitem\"]");
|
|
123
|
+
if (target && target.getAttribute("aria-disabled") !== "true" && !event.defaultPrevented) close();
|
|
124
|
+
},
|
|
125
|
+
children
|
|
126
|
+
})] });
|
|
127
|
+
}
|
|
128
|
+
function MenuItem({ icon, shortcut: shortcut$1, tone = "neutral", onSelect, onClick, disabled, className, children, ...rest }) {
|
|
129
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
130
|
+
...rest,
|
|
131
|
+
type: "button",
|
|
132
|
+
role: "menuitem",
|
|
133
|
+
tabIndex: -1,
|
|
134
|
+
"aria-disabled": disabled || void 0,
|
|
135
|
+
"data-tone": tone === "danger" ? "danger" : void 0,
|
|
136
|
+
className: cx(item, className),
|
|
137
|
+
onClick: (event) => {
|
|
138
|
+
if (disabled) {
|
|
139
|
+
event.preventDefault();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
onClick?.(event);
|
|
143
|
+
onSelect?.(event);
|
|
144
|
+
},
|
|
145
|
+
children: [
|
|
146
|
+
icon && /* @__PURE__ */ jsx(Icon, {
|
|
147
|
+
icon,
|
|
148
|
+
size: 18,
|
|
149
|
+
className: "ml_14nyzek2"
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsx("span", {
|
|
152
|
+
className: itemLabel,
|
|
153
|
+
children
|
|
154
|
+
}),
|
|
155
|
+
shortcut$1 && /* @__PURE__ */ jsx("kbd", {
|
|
156
|
+
className: "ml_14nyzek4",
|
|
157
|
+
"aria-hidden": "true",
|
|
158
|
+
children: shortcut$1
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/** A hairline between groups of items. */
|
|
164
|
+
function MenuSeparator({ className, ...rest }) {
|
|
165
|
+
return /* @__PURE__ */ jsx("hr", {
|
|
166
|
+
...rest,
|
|
167
|
+
className: cx(separator, className)
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/** Related items under a small heading. */
|
|
171
|
+
function MenuGroup({ label, className, children, ...rest }) {
|
|
172
|
+
const id = useId();
|
|
173
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
174
|
+
...rest,
|
|
175
|
+
role: "group",
|
|
176
|
+
"aria-labelledby": id,
|
|
177
|
+
className,
|
|
178
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
179
|
+
id,
|
|
180
|
+
className: groupLabel,
|
|
181
|
+
"aria-hidden": "true",
|
|
182
|
+
children: label
|
|
183
|
+
}), children]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
export { Menu, MenuGroup, MenuItem, MenuSeparator };
|
|
187
|
+
|
|
188
|
+
//# sourceMappingURL=menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.js","names":["styles.popover","styles.menu","shortcut","styles.item","styles.itemLabel","styles.separator","styles.groupLabel"],"sources":["../../../src/components/menu/menu.tsx"],"sourcesContent":["import {\n cloneElement,\n useEffect,\n useId,\n useRef,\n type ComponentPropsWithRef,\n type CSSProperties,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport type { IconData } from '@mohirlab/icons';\nimport { cx } from '../../utils/cx';\nimport { Icon } from '../icon';\nimport { useAnchorName } from '../popover/popover';\nimport type { Placement } from '../popover/popover.css';\nimport * as styles from './menu.css';\n\ntype TriggerProps = {\n id?: string;\n style?: CSSProperties;\n popoverTarget?: string;\n 'aria-haspopup'?: 'menu';\n onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;\n};\n\nconst ITEM = '[role=\"menuitem\"]:not([aria-disabled=\"true\"])';\n\nconst items = (menu: HTMLElement) => [...menu.querySelectorAll<HTMLElement>(ITEM)];\n\nexport interface MenuProps extends Omit<ComponentPropsWithRef<'div'>, 'popover'> {\n /** The button that opens it: usually a `Button`. It must be a `<button>`. */\n trigger: ReactElement<TriggerProps>;\n placement?: Placement;\n onOpenChange?: (open: boolean) => void;\n children: ReactNode;\n}\n\n/**\n * A list of actions behind a button: \"More\", row actions, account menus.\n * The Popover API gives light dismiss, Escape and the top layer; the keyboard follows the\n * WAI-ARIA menu button pattern: arrows, Home, End and type-to-find. For choosing a value\n * use `Select` or `Combobox`, and for navigation use links.\n */\nexport function Menu({\n trigger,\n placement = 'bottom-start',\n onOpenChange,\n className,\n style,\n children,\n ...rest\n}: MenuProps) {\n const menuId = useId();\n const triggerId = useId();\n const anchor = useAnchorName();\n const ref = useRef<HTMLDivElement>(null);\n /** Which item to focus when the menu opens: first, or last after ArrowUp on the trigger. */\n const focusOnOpen = useRef<'first' | 'last'>('first');\n const typed = useRef({ text: '', at: 0 });\n const onOpenChangeRef = useRef(onOpenChange);\n useEffect(() => {\n onOpenChangeRef.current = onOpenChange;\n });\n\n useEffect(() => {\n const menu = ref.current;\n if (!menu) return;\n const onToggle = (event: Event) => {\n const open = (event as ToggleEvent).newState === 'open';\n if (open) {\n const list = items(menu);\n (focusOnOpen.current === 'last' ? list.at(-1) : list[0])?.focus();\n focusOnOpen.current = 'first';\n }\n onOpenChangeRef.current?.(open);\n };\n menu.addEventListener('toggle', onToggle);\n return () => menu.removeEventListener('toggle', onToggle);\n }, []);\n\n const triggerEl = () => document.getElementById(trigger.props.id ?? triggerId);\n\n const close = () => {\n const menu = ref.current;\n if (menu?.matches(':popover-open')) menu.hidePopover();\n triggerEl()?.focus();\n };\n\n const onMenuKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const menu = event.currentTarget;\n const list = items(menu);\n const index = list.indexOf(document.activeElement as HTMLElement);\n const move = (to: number) => list[(to + list.length) % list.length]?.focus();\n switch (event.key) {\n case 'ArrowDown':\n move(index + 1);\n break;\n case 'ArrowUp':\n move(index < 0 ? -1 : index - 1);\n break;\n case 'Home':\n move(0);\n break;\n case 'End':\n move(-1);\n break;\n case 'Escape':\n close();\n break;\n case 'Tab':\n // Leave the menu: close it and let Tab move on from the trigger.\n menu.hidePopover();\n return;\n default: {\n // Type to find: jump to the next item starting with what was typed.\n if (event.key.length !== 1 || event.ctrlKey || event.metaKey || event.altKey) return;\n const now = Date.now();\n typed.current.text =\n (now - typed.current.at > 500 ? '' : typed.current.text) + event.key.toLowerCase();\n typed.current.at = now;\n const text = typed.current.text;\n const ordered = [...list.slice(index + 1), ...list.slice(0, index + 1)];\n const repeat = text.length > 1 && [...text].every((c) => c === text[0]);\n const match = ordered.find((el) =>\n (el.textContent ?? '')\n .trim()\n .toLowerCase()\n .startsWith(repeat ? text[0]! : text),\n );\n match?.focus();\n }\n }\n event.preventDefault();\n };\n\n const props = trigger.props;\n // The handlers below read refs only when the events fire; the rule cannot see that\n // through cloneElement.\n // oxlint-disable-next-line react/refs\n const wiredTrigger = cloneElement(trigger, {\n id: props.id ?? triggerId,\n popoverTarget: menuId,\n 'aria-haspopup': 'menu',\n style: { ...props.style, anchorName: anchor } as CSSProperties,\n onKeyDown: (event: KeyboardEvent<HTMLElement>) => {\n props.onKeyDown?.(event);\n // Arrow keys on the trigger open the menu at the first or last item.\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n event.preventDefault();\n focusOnOpen.current = event.key === 'ArrowUp' ? 'last' : 'first';\n ref.current?.showPopover();\n },\n });\n\n return (\n <>\n {wiredTrigger}\n <div\n {...rest}\n ref={ref}\n id={menuId}\n popover=\"auto\"\n role=\"menu\"\n aria-labelledby={props.id ?? triggerId}\n tabIndex={-1}\n className={cx(styles.popover({ placement }), styles.menu, className)}\n style={{ ...style, positionAnchor: anchor } as CSSProperties}\n onKeyDown={onMenuKeyDown}\n onClick={(event: MouseEvent<HTMLDivElement>) => {\n // An item was chosen: close, and put focus back on the trigger.\n const target = (event.target as HTMLElement).closest('[role=\"menuitem\"]');\n if (target && target.getAttribute('aria-disabled') !== 'true' && !event.defaultPrevented) close();\n }}\n >\n {children}\n </div>\n </>\n );\n}\n\nexport interface MenuItemProps extends Omit<ComponentPropsWithRef<'button'>, 'onSelect'> {\n icon?: IconData;\n /** Keyboard shortcut hint, e.g. \"⌘D\". Display only: wire the shortcut yourself. */\n shortcut?: string;\n /** `danger` for destructive actions such as Delete. */\n tone?: 'neutral' | 'danger';\n /**\n * Called when the item is chosen by click, Enter or Space. The menu then closes;\n * call `event.preventDefault()` to keep it open.\n */\n onSelect?: (event: MouseEvent<HTMLButtonElement>) => void;\n}\n\nexport function MenuItem({\n icon,\n shortcut,\n tone = 'neutral',\n onSelect,\n onClick,\n disabled,\n className,\n children,\n ...rest\n}: MenuItemProps) {\n return (\n <button\n {...rest}\n type=\"button\"\n role=\"menuitem\"\n tabIndex={-1}\n // aria-disabled, not disabled: disabled items stay reachable with the arrow keys.\n aria-disabled={disabled || undefined}\n data-tone={tone === 'danger' ? 'danger' : undefined}\n className={cx(styles.item, className)}\n onClick={(event) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n onSelect?.(event);\n }}\n >\n {icon && <Icon icon={icon} size={18} className={styles.itemIcon} />}\n <span className={styles.itemLabel}>{children}</span>\n {shortcut && (\n <kbd className={styles.shortcut} aria-hidden=\"true\">\n {shortcut}\n </kbd>\n )}\n </button>\n );\n}\n\n/** A hairline between groups of items. */\nexport function MenuSeparator({ className, ...rest }: ComponentPropsWithRef<'hr'>) {\n return <hr {...rest} className={cx(styles.separator, className)} />;\n}\n\nexport interface MenuGroupProps extends ComponentPropsWithRef<'div'> {\n /** A short heading for the group, e.g. \"Sort by\". */\n label: ReactNode;\n}\n\n/** Related items under a small heading. */\nexport function MenuGroup({ label, className, children, ...rest }: MenuGroupProps) {\n const id = useId();\n return (\n // A <fieldset> is a form grouping; inside a menu the ARIA pattern asks for role=group.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n <div {...rest} role=\"group\" aria-labelledby={id} className={className}>\n <div id={id} className={styles.groupLabel} aria-hidden=\"true\">\n {label}\n </div>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA2BA,MAAM,OAAO;AAEb,MAAM,SAAS,SAAsB,CAAC,GAAG,KAAK,iBAA8B,IAAI,CAAC;;;;;;;AAgBjF,SAAgB,KAAK,EACnB,SACA,YAAY,gBACZ,cACA,WACA,OACA,UACA,GAAG,QACS;CACZ,MAAM,SAAS,MAAM;CACrB,MAAM,YAAY,MAAM;CACxB,MAAM,SAAS,cAAc;CAC7B,MAAM,MAAM,OAAuB,IAAI;;CAEvC,MAAM,cAAc,OAAyB,OAAO;CACpD,MAAM,QAAQ,OAAO;EAAE,MAAM;EAAI,IAAI;CAAE,CAAC;CACxC,MAAM,kBAAkB,OAAO,YAAY;CAC3C,gBAAgB;EACd,gBAAgB,UAAU;CAC5B,CAAC;CAED,gBAAgB;EACd,MAAM,OAAO,IAAI;EACjB,IAAI,CAAC,MAAM;EACX,MAAM,YAAY,UAAiB;GACjC,MAAM,OAAQ,MAAsB,aAAa;GACjD,IAAI,MAAM;IACR,MAAM,OAAO,MAAM,IAAI;IACvB,CAAC,YAAY,YAAY,SAAS,KAAK,GAAG,EAAE,IAAI,KAAK,GAAA,EAAK,MAAM;IAChE,YAAY,UAAU;GACxB;GACA,gBAAgB,UAAU,IAAI;EAChC;EACA,KAAK,iBAAiB,UAAU,QAAQ;EACxC,aAAa,KAAK,oBAAoB,UAAU,QAAQ;CAC1D,GAAG,CAAC,CAAC;CAEL,MAAM,kBAAkB,SAAS,eAAe,QAAQ,MAAM,MAAM,SAAS;CAE7E,MAAM,cAAc;EAClB,MAAM,OAAO,IAAI;EACjB,IAAI,MAAM,QAAQ,eAAe,GAAG,KAAK,YAAY;EACrD,UAAU,CAAC,EAAE,MAAM;CACrB;CAEA,MAAM,iBAAiB,UAAyC;EAC9D,MAAM,OAAO,MAAM;EACnB,MAAM,OAAO,MAAM,IAAI;EACvB,MAAM,QAAQ,KAAK,QAAQ,SAAS,aAA4B;EAChE,MAAM,QAAQ,OAAe,MAAM,KAAK,KAAK,UAAU,KAAK,OAAO,EAAE,MAAM;EAC3E,QAAQ,MAAM,KAAd;GACE,KAAK;IACH,KAAK,QAAQ,CAAC;IACd;GACF,KAAK;IACH,KAAK,QAAQ,IAAI,KAAK,QAAQ,CAAC;IAC/B;GACF,KAAK;IACH,KAAK,CAAC;IACN;GACF,KAAK;IACH,KAAK,EAAE;IACP;GACF,KAAK;IACH,MAAM;IACN;GACF,KAAK;IAEH,KAAK,YAAY;IACjB;GACF,SAAS;IAEP,IAAI,MAAM,IAAI,WAAW,KAAK,MAAM,WAAW,MAAM,WAAW,MAAM,QAAQ;IAC9E,MAAM,MAAM,KAAK,IAAI;IACrB,MAAM,QAAQ,QACX,MAAM,MAAM,QAAQ,KAAK,MAAM,KAAK,MAAM,QAAQ,QAAQ,MAAM,IAAI,YAAY;IACnF,MAAM,QAAQ,KAAK;IACnB,MAAM,OAAO,MAAM,QAAQ;IAC3B,MAAM,UAAU,CAAC,GAAG,KAAK,MAAM,QAAQ,CAAC,GAAG,GAAG,KAAK,MAAM,GAAG,QAAQ,CAAC,CAAC;IACtE,MAAM,SAAS,KAAK,SAAS,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,MAAM,MAAM,KAAK,EAAE;IACxD,QAAQ,MAAM,QACzB,GAAG,eAAe,GAAA,CAChB,KAAK,CAAC,CACN,YAAY,CAAC,CACb,WAAW,SAAS,KAAK,KAAM,IAAI,CAEpC,CAAC,EAAE,MAAM;GACf;EACF;EACA,MAAM,eAAe;CACvB;CAEA,MAAM,QAAQ,QAAQ;CAItB,MAAM,eAAe,aAAa,SAAS;EACzC,IAAI,MAAM,MAAM;EAChB,eAAe;EACf,iBAAiB;EACjB,OAAO;GAAE,GAAG,MAAM;GAAO,YAAY;EAAO;EAC5C,YAAY,UAAsC;GAChD,MAAM,YAAY,KAAK;GAEvB,IAAI,MAAM,QAAQ,eAAe,MAAM,QAAQ,WAAW;GAC1D,MAAM,eAAe;GACrB,YAAY,UAAU,MAAM,QAAQ,YAAY,SAAS;GACzD,IAAI,SAAS,YAAY;EAC3B;CACF,CAAC;CAED,OACE,qBAAA,UAAA,EAAA,UAAA,CACG,cACD,oBAAC,OAAD;EACE,GAAI;EACC;EACL,IAAI;EACJ,SAAQ;EACR,MAAK;EACL,mBAAiB,MAAM,MAAM;EAC7B,UAAU;EACV,WAAW,GAAGA,QAAe,EAAE,UAAU,CAAC,GAAGC,MAAa,SAAS;EACnE,OAAO;GAAE,GAAG;GAAO,gBAAgB;EAAO;EAC1C,WAAW;EACX,UAAU,UAAsC;GAE9C,MAAM,SAAU,MAAM,OAAuB,QAAQ,qBAAmB;GACxE,IAAI,UAAU,OAAO,aAAa,eAAe,MAAM,UAAU,CAAC,MAAM,kBAAkB,MAAM;EAClG;EAEC;CACE,CAAA,CACL,EAAA,CAAA;AAEN;AAeA,SAAgB,SAAS,EACvB,MACAC,UAAAA,YACA,OAAO,WACP,UACA,SACA,UACA,WACA,UACA,GAAG,QACa;CAChB,OACE,qBAAC,UAAD;EACE,GAAI;EACJ,MAAK;EACL,MAAK;EACL,UAAU;EAEV,iBAAe,YAAY,KAAA;EAC3B,aAAW,SAAS,WAAW,WAAW,KAAA;EAC1C,WAAW,GAAGC,MAAa,SAAS;EACpC,UAAU,UAAU;GAClB,IAAI,UAAU;IACZ,MAAM,eAAe;IACrB;GACF;GACA,UAAU,KAAK;GACf,WAAW,KAAK;EAClB;EAhBF,UAAA;GAkBG,QAAQ,oBAAC,MAAD;IAAY;IAAM,MAAM;IAAI,WAAW;GAAkB,CAAA;GAClE,oBAAC,QAAD;IAAM,WAAWC;IAAmB;GAAe,CAAA;GAClDF,cACC,oBAAC,OAAD;IAAK,WAAW;IAAiB,eAAY;IAC1CA,UAAAA;GACE,CAAA;EAED;;AAEZ;;AAGA,SAAgB,cAAc,EAAE,WAAW,GAAG,QAAqC;CACjF,OAAO,oBAAC,MAAD;EAAI,GAAI;EAAM,WAAW,GAAGG,WAAkB,SAAS;CAAI,CAAA;AACpE;;AAQA,SAAgB,UAAU,EAAE,OAAO,WAAW,UAAU,GAAG,QAAwB;CACjF,MAAM,KAAK,MAAM;CACjB,OAGE,qBAAC,OAAD;EAAK,GAAI;EAAM,MAAK;EAAQ,mBAAiB;EAAe;EAA5D,UAAA,CACE,oBAAC,OAAD;GAAS;GAAI,WAAWC;GAAmB,eAAY;GACpD,UAAA;EACE,CAAA,GACJ,QACE;;AAET"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
// src/components/menu/menu.css.ts
|
|
4
|
+
var groupLabel = "ml_14nyzek6";
|
|
5
|
+
var item = "ml_14nyzek1";
|
|
6
|
+
var itemIcon = "ml_14nyzek2";
|
|
7
|
+
var itemLabel = "ml_14nyzek3";
|
|
8
|
+
var menu = "ml_14nyzek0";
|
|
9
|
+
var popover = createRuntimeFn({
|
|
10
|
+
defaultClassName: "ml_12557yp0",
|
|
11
|
+
variantClassNames: { placement: {
|
|
12
|
+
top: "ml_placement_top_12557yp1",
|
|
13
|
+
"top-start": "ml_placement_top-start_12557yp2",
|
|
14
|
+
"top-end": "ml_placement_top-end_12557yp3",
|
|
15
|
+
bottom: "ml_placement_bottom_12557yp4",
|
|
16
|
+
"bottom-start": "ml_placement_bottom-start_12557yp5",
|
|
17
|
+
"bottom-end": "ml_placement_bottom-end_12557yp6",
|
|
18
|
+
start: "ml_placement_start_12557yp7",
|
|
19
|
+
end: "ml_placement_end_12557yp8"
|
|
20
|
+
} },
|
|
21
|
+
defaultVariants: { placement: "bottom-start" },
|
|
22
|
+
compoundVariants: []
|
|
23
|
+
});
|
|
24
|
+
var separator = "ml_14nyzek5";
|
|
25
|
+
var shortcut = "ml_14nyzek4";
|
|
26
|
+
export { groupLabel, item, itemIcon, itemLabel, menu, popover, separator, shortcut };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=menu.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.styles.js","names":[],"sources":[],"mappings":""}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
1
2
|
import { Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabProps, Tabs, TabsProps } from "./tabs.js";
|
|
2
3
|
import { BottomNav, BottomNavItem, BottomNavProps, BottomNavSpacer, Breadcrumbs, BreadcrumbsProps, Crumb, SegmentedControl, SegmentedControlProps, SegmentedOption } from "./nav.js";
|
|
3
|
-
|
|
4
|
+
import { Pagination, PaginationLabels, PaginationProps, pageRange } from "./pagination.js";
|
|
5
|
+
export { BottomNav, BottomNavItem, type BottomNavProps, BottomNavSpacer, Breadcrumbs, type BreadcrumbsProps, type Crumb, Pagination, type PaginationLabels, type PaginationProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, pageRange };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav.d.ts","names":[],"sources":["../../../src/components/navigation/nav.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"nav.d.ts","names":[],"sources":["../../../src/components/navigation/nav.tsx"],"mappings":";;;iBAQiB;EACf;EACA,OAAO;EACP,OAAO;EACP;;iBAGe,8BAA8B,KAC7C;;EAIA;EACA,SAAS;EACT;EACA;EACA,iBAAiB;EACjB;;EAEA;;;;;;wBAOc,mBACd,SACA,OACA,cACA,eACA,MACA,WACA,cACG,QACF,wCAAqB,IAAA;iBAqCP,uBAAuB;;EAEtC;;EAEA;;;;;;;wBAQc,YAAY,UAAqB,cAAc,QAAQ,iCAAc,IAAA;KAIhF;EACH,MAAM;EACN;;EAEA;;EAEA;EACA;;EAEK;IAAiB,KAAK;EACtB;IAAqB,KAAK;wBAGjB,gBAAgB,MAAM,OAAO,SAAS,OAAO,cAAc,QAAQ,qCAAkB,IAAA;;wBAiCrF,kBAAkB,YAAuB,KAAK,8CAA2B,IAAA;iBAMxE;EACf,OAAO;EACP;;iBAGe,yBAAyB,KAAK;;EAE7C,OAAO;;;;;;wBAOO,cACd,OACA,yBACc,cACX,QACF,mCAAgB,IAAA"}
|