@cerberus-design/react 0.0.1-next-2f6c207 → 0.0.1-next-5f0577b
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/build/legacy/_tsup-dts-rollup.d.cts +17 -0
- package/build/legacy/_tsup-dts-rollup.d.ts +17 -0
- package/build/legacy/components/Button.cjs +2 -2
- package/build/legacy/components/Button.cjs.map +1 -1
- package/build/legacy/components/Button.js +2 -2
- package/build/legacy/components/Button.js.map +1 -1
- package/build/legacy/components/NavMenuLink.cjs +1 -1
- package/build/legacy/components/NavMenuLink.cjs.map +1 -1
- package/build/legacy/components/NavMenuLink.js +1 -1
- package/build/legacy/components/NavMenuLink.js.map +1 -1
- package/build/legacy/components/NavMenuList.cjs +2 -2
- package/build/legacy/components/NavMenuList.cjs.map +1 -1
- package/build/legacy/components/NavMenuList.js +2 -2
- package/build/legacy/components/NavMenuList.js.map +1 -1
- package/build/legacy/components/NavMenuTrigger.cjs +2 -2
- package/build/legacy/components/NavMenuTrigger.cjs.map +1 -1
- package/build/legacy/components/NavMenuTrigger.js +2 -2
- package/build/legacy/components/NavMenuTrigger.js.map +1 -1
- package/build/legacy/context/field.cjs +55 -0
- package/build/legacy/context/field.cjs.map +1 -0
- package/build/legacy/context/field.d.cts +3 -0
- package/build/legacy/context/field.d.ts +3 -0
- package/build/legacy/context/field.js +34 -0
- package/build/legacy/context/field.js.map +1 -0
- package/build/legacy/context/navMenu.cjs +1 -1
- package/build/legacy/context/navMenu.cjs.map +1 -1
- package/build/legacy/context/navMenu.js +1 -1
- package/build/legacy/context/navMenu.js.map +1 -1
- package/build/legacy/global.d.cjs +2 -0
- package/build/legacy/global.d.cjs.map +1 -0
- package/build/legacy/global.d.d.cts +1 -0
- package/build/legacy/global.d.d.ts +1 -0
- package/build/legacy/global.d.js +1 -0
- package/build/legacy/global.d.js.map +1 -0
- package/build/legacy/index.cjs +2 -0
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +3 -0
- package/build/legacy/index.d.ts +3 -0
- package/build/legacy/index.js +1 -0
- package/build/legacy/index.js.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.cts +17 -0
- package/build/modern/_tsup-dts-rollup.d.ts +17 -0
- package/build/modern/components/Button.cjs +2 -2
- package/build/modern/components/Button.cjs.map +1 -1
- package/build/modern/components/Button.js +2 -2
- package/build/modern/components/Button.js.map +1 -1
- package/build/modern/components/NavMenuLink.cjs +1 -1
- package/build/modern/components/NavMenuLink.cjs.map +1 -1
- package/build/modern/components/NavMenuLink.js +1 -1
- package/build/modern/components/NavMenuLink.js.map +1 -1
- package/build/modern/components/NavMenuList.cjs +2 -2
- package/build/modern/components/NavMenuList.cjs.map +1 -1
- package/build/modern/components/NavMenuList.js +2 -2
- package/build/modern/components/NavMenuList.js.map +1 -1
- package/build/modern/components/NavMenuTrigger.cjs +2 -2
- package/build/modern/components/NavMenuTrigger.cjs.map +1 -1
- package/build/modern/components/NavMenuTrigger.js +2 -2
- package/build/modern/components/NavMenuTrigger.js.map +1 -1
- package/build/modern/context/field.cjs +55 -0
- package/build/modern/context/field.cjs.map +1 -0
- package/build/modern/context/field.d.cts +3 -0
- package/build/modern/context/field.d.ts +3 -0
- package/build/modern/context/field.js +34 -0
- package/build/modern/context/field.js.map +1 -0
- package/build/modern/context/navMenu.cjs +1 -1
- package/build/modern/context/navMenu.cjs.map +1 -1
- package/build/modern/context/navMenu.js +1 -1
- package/build/modern/context/navMenu.js.map +1 -1
- package/build/modern/global.d.cjs +2 -0
- package/build/modern/global.d.cjs.map +1 -0
- package/build/modern/global.d.d.cts +1 -0
- package/build/modern/global.d.d.ts +1 -0
- package/build/modern/global.d.js +1 -0
- package/build/modern/global.d.js.map +1 -0
- package/build/modern/index.cjs +2 -0
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +3 -0
- package/build/modern/index.d.ts +3 -0
- package/build/modern/index.js +1 -0
- package/build/modern/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Button.tsx +2 -2
- package/src/components/NavMenuLink.tsx +1 -1
- package/src/components/NavMenuList.tsx +2 -2
- package/src/components/NavMenuTrigger.tsx +2 -2
- package/src/context/field.tsx +45 -0
- package/src/context/navMenu.tsx +1 -1
- package/src/global.d.ts +19 -0
- package/src/index.ts +1 -0
|
@@ -38,6 +38,19 @@ declare type DefaultThemes = 'cerberus';
|
|
|
38
38
|
export { DefaultThemes }
|
|
39
39
|
export { DefaultThemes as DefaultThemes_alias_1 }
|
|
40
40
|
|
|
41
|
+
declare function Field(props: PropsWithChildren<FieldContextValue>): JSX.Element;
|
|
42
|
+
export { Field }
|
|
43
|
+
export { Field as Field_alias_1 }
|
|
44
|
+
|
|
45
|
+
declare interface FieldContextValue {
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
readonly?: boolean;
|
|
48
|
+
required?: boolean;
|
|
49
|
+
invalid?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export { FieldContextValue }
|
|
52
|
+
export { FieldContextValue as FieldContextValue_alias_1 }
|
|
53
|
+
|
|
41
54
|
declare function getPosition(position: Positions): GetPositionResult;
|
|
42
55
|
export { getPosition }
|
|
43
56
|
export { getPosition as getPosition_alias_1 }
|
|
@@ -193,6 +206,10 @@ declare function ThemeProvider(props: PropsWithChildren<unknown>): JSX.Element;
|
|
|
193
206
|
export { ThemeProvider }
|
|
194
207
|
export { ThemeProvider as ThemeProvider_alias_1 }
|
|
195
208
|
|
|
209
|
+
declare function useFieldContext(): FieldContextValue;
|
|
210
|
+
export { useFieldContext }
|
|
211
|
+
export { useFieldContext as useFieldContext_alias_1 }
|
|
212
|
+
|
|
196
213
|
declare function useNavMenuContext(): NavMenuContextValue;
|
|
197
214
|
export { useNavMenuContext }
|
|
198
215
|
export { useNavMenuContext as useNavMenuContext_alias_1 }
|
|
@@ -38,6 +38,19 @@ declare type DefaultThemes = 'cerberus';
|
|
|
38
38
|
export { DefaultThemes }
|
|
39
39
|
export { DefaultThemes as DefaultThemes_alias_1 }
|
|
40
40
|
|
|
41
|
+
declare function Field(props: PropsWithChildren<FieldContextValue>): JSX.Element;
|
|
42
|
+
export { Field }
|
|
43
|
+
export { Field as Field_alias_1 }
|
|
44
|
+
|
|
45
|
+
declare interface FieldContextValue {
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
readonly?: boolean;
|
|
48
|
+
required?: boolean;
|
|
49
|
+
invalid?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export { FieldContextValue }
|
|
52
|
+
export { FieldContextValue as FieldContextValue_alias_1 }
|
|
53
|
+
|
|
41
54
|
declare function getPosition(position: Positions): GetPositionResult;
|
|
42
55
|
export { getPosition }
|
|
43
56
|
export { getPosition as getPosition_alias_1 }
|
|
@@ -193,6 +206,10 @@ declare function ThemeProvider(props: PropsWithChildren<unknown>): JSX.Element;
|
|
|
193
206
|
export { ThemeProvider }
|
|
194
207
|
export { ThemeProvider as ThemeProvider_alias_1 }
|
|
195
208
|
|
|
209
|
+
declare function useFieldContext(): FieldContextValue;
|
|
210
|
+
export { useFieldContext }
|
|
211
|
+
export { useFieldContext as useFieldContext_alias_1 }
|
|
212
|
+
|
|
196
213
|
declare function useNavMenuContext(): NavMenuContextValue;
|
|
197
214
|
export { useNavMenuContext }
|
|
198
215
|
export { useNavMenuContext as useNavMenuContext_alias_1 }
|
|
@@ -23,8 +23,8 @@ __export(Button_exports, {
|
|
|
23
23
|
Button: () => Button
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(Button_exports);
|
|
26
|
-
var import_css = require("@cerberus
|
|
27
|
-
var import_recipes = require("@cerberus
|
|
26
|
+
var import_css = require("@cerberus/styled-system/css.cjs");
|
|
27
|
+
var import_recipes = require("@cerberus/styled-system/recipes.cjs");
|
|
28
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
29
|
function Button(props) {
|
|
30
30
|
const { palette, usage, shape, ...nativeProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outline' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAmB;AACnB,qBAAuB;AAenB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,eAAW;AAAA,QACT,YAAY;AAAA,YACZ,uBAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/Button.tsx
|
|
2
|
-
import { cx } from "@cerberus
|
|
3
|
-
import { button } from "@cerberus
|
|
2
|
+
import { cx } from "@cerberus/styled-system/css.js";
|
|
3
|
+
import { button } from "@cerberus/styled-system/recipes.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
function Button(props) {
|
|
6
6
|
const { palette, usage, shape, ...nativeProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outline' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,cAAc;AAenB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -24,7 +24,7 @@ __export(NavMenuLink_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(NavMenuLink_exports);
|
|
26
26
|
var import_Show = require("./Show.cjs");
|
|
27
|
-
var import_css = require("@cerberus
|
|
27
|
+
var import_css = require("@cerberus/styled-system/css.cjs");
|
|
28
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
29
|
function NavMenuLink(props) {
|
|
30
30
|
const { as, ...nativeProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/NavMenuLink.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, ElementType } from 'react'\nimport { Show } from './Show'\nimport { css, cx } from '@cerberus
|
|
1
|
+
{"version":3,"sources":["../../../src/components/NavMenuLink.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, ElementType } from 'react'\nimport { Show } from './Show'\nimport { css, cx } from '@cerberus/styled-system/css'\n\nexport interface NavMenuLinkProps\n extends AnchorHTMLAttributes<HTMLAnchorElement> {\n as?: ElementType\n}\n\nexport function NavMenuLink(props: NavMenuLinkProps): JSX.Element {\n const { as, ...nativeProps } = props\n const hasAs = Boolean(as)\n const AsSub: ElementType = as!\n\n return (\n <li\n className={css({\n w: 'full',\n })}\n >\n <Show\n when={hasAs}\n fallback={\n <a\n {...nativeProps}\n className={cx(\n nativeProps.className,\n css({\n color: 'action.navigation.initial',\n textStyle: 'link',\n _hover: {\n color: 'action.navigation.hover',\n },\n }),\n )}\n />\n }\n >\n {hasAs && <AsSub {...nativeProps} />}\n </Show>\n </li>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAqB;AACrB,iBAAwB;AAqBd;AAdH,SAAS,YAAY,OAAsC;AAChE,QAAM,EAAE,IAAI,GAAG,YAAY,IAAI;AAC/B,QAAM,QAAQ,QAAQ,EAAE;AACxB,QAAM,QAAqB;AAE3B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,gBAAI;AAAA,QACb,GAAG;AAAA,MACL,CAAC;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,UACE;AAAA,YAAC;AAAA;AAAA,cACE,GAAG;AAAA,cACJ,eAAW;AAAA,gBACT,YAAY;AAAA,oBACZ,gBAAI;AAAA,kBACF,OAAO;AAAA,kBACP,WAAW;AAAA,kBACX,QAAQ;AAAA,oBACN,OAAO;AAAA,kBACT;AAAA,gBACF,CAAC;AAAA,cACH;AAAA;AAAA,UACF;AAAA,UAGD,mBAAS,4CAAC,SAAO,GAAG,aAAa;AAAA;AAAA,MACpC;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/NavMenuLink.tsx
|
|
2
2
|
import { Show } from "./Show.js";
|
|
3
|
-
import { css, cx } from "@cerberus
|
|
3
|
+
import { css, cx } from "@cerberus/styled-system/css.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
function NavMenuLink(props) {
|
|
6
6
|
const { as, ...nativeProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/NavMenuLink.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, ElementType } from 'react'\nimport { Show } from './Show'\nimport { css, cx } from '@cerberus
|
|
1
|
+
{"version":3,"sources":["../../../src/components/NavMenuLink.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, ElementType } from 'react'\nimport { Show } from './Show'\nimport { css, cx } from '@cerberus/styled-system/css'\n\nexport interface NavMenuLinkProps\n extends AnchorHTMLAttributes<HTMLAnchorElement> {\n as?: ElementType\n}\n\nexport function NavMenuLink(props: NavMenuLinkProps): JSX.Element {\n const { as, ...nativeProps } = props\n const hasAs = Boolean(as)\n const AsSub: ElementType = as!\n\n return (\n <li\n className={css({\n w: 'full',\n })}\n >\n <Show\n when={hasAs}\n fallback={\n <a\n {...nativeProps}\n className={cx(\n nativeProps.className,\n css({\n color: 'action.navigation.initial',\n textStyle: 'link',\n _hover: {\n color: 'action.navigation.hover',\n },\n }),\n )}\n />\n }\n >\n {hasAs && <AsSub {...nativeProps} />}\n </Show>\n </li>\n )\n}\n"],"mappings":";AACA,SAAS,YAAY;AACrB,SAAS,KAAK,UAAU;AAqBd;AAdH,SAAS,YAAY,OAAsC;AAChE,QAAM,EAAE,IAAI,GAAG,YAAY,IAAI;AAC/B,QAAM,QAAQ,QAAQ,EAAE;AACxB,QAAM,QAAqB;AAE3B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,IAAI;AAAA,QACb,GAAG;AAAA,MACL,CAAC;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,UACE;AAAA,YAAC;AAAA;AAAA,cACE,GAAG;AAAA,cACJ,WAAW;AAAA,gBACT,YAAY;AAAA,gBACZ,IAAI;AAAA,kBACF,OAAO;AAAA,kBACP,WAAW;AAAA,kBACX,QAAQ;AAAA,oBACN,OAAO;AAAA,kBACT;AAAA,gBACF,CAAC;AAAA,cACH;AAAA;AAAA,UACF;AAAA,UAGD,mBAAS,oBAAC,SAAO,GAAG,aAAa;AAAA;AAAA,MACpC;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -28,8 +28,8 @@ module.exports = __toCommonJS(NavMenuList_exports);
|
|
|
28
28
|
var import_react = require("react");
|
|
29
29
|
var import_navMenu = require("../context/navMenu.cjs");
|
|
30
30
|
var import_Show = require("./Show.cjs");
|
|
31
|
-
var import_css = require("@cerberus
|
|
32
|
-
var import_patterns = require("@cerberus
|
|
31
|
+
var import_css = require("@cerberus/styled-system/css.cjs");
|
|
32
|
+
var import_patterns = require("@cerberus/styled-system/patterns.cjs");
|
|
33
33
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
34
|
function getPosition(position) {
|
|
35
35
|
const defaultPositions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/NavMenuList.tsx"],"sourcesContent":["'use client'\n\nimport { useMemo, type HTMLAttributes } from 'react'\nimport { useNavMenuContext } from '../context/navMenu'\nimport { Show } from './Show'\nimport type { Positions } from '../types'\nimport { cx } from '@cerberus
|
|
1
|
+
{"version":3,"sources":["../../../src/components/NavMenuList.tsx"],"sourcesContent":["'use client'\n\nimport { useMemo, type HTMLAttributes } from 'react'\nimport { useNavMenuContext } from '../context/navMenu'\nimport { Show } from './Show'\nimport type { Positions } from '../types'\nimport { cx } from '@cerberus/styled-system/css'\nimport { vstack } from '@cerberus/styled-system/patterns'\n\ninterface GetPositionResult {\n left: string\n right: string\n top: string\n bottom: string\n}\n\nexport function getPosition(position: Positions): GetPositionResult {\n const defaultPositions = {\n left: 'auto',\n right: 'auto',\n top: 'auto',\n bottom: 'auto',\n }\n switch (position) {\n case 'right':\n return { ...defaultPositions, top: '0%', left: '105%' }\n case 'left':\n return { ...defaultPositions, top: '0%', right: '105%' }\n case 'bottom':\n return { ...defaultPositions, top: '110%' }\n case 'top':\n return { ...defaultPositions, bottom: '110%' }\n default:\n return defaultPositions\n }\n}\n\nconst navListStyles = vstack({\n alignItems: 'flex-start',\n bgColor: 'neutral.surface.100',\n boxShadow: 'lg',\n gap: '2',\n opacity: '0',\n p: '4',\n position: 'absolute',\n rounded: 'md',\n zIndex: 'dropdown',\n _motionSafe: {\n animationName: 'zoomIn',\n animationDelay: '100ms',\n animationDuration: '150ms',\n animationFillMode: 'both',\n animationTimingFunction: 'ease-in-out',\n },\n _positionBottom: {\n transformOrigin: 'top left',\n },\n _positionTop: {\n transformOrigin: 'bottom left',\n },\n _positionLeft: {\n transformOrigin: 'top right',\n },\n _positionRight: {\n transformOrigin: 'top left',\n },\n})\n\nexport interface NavMenuListProps extends HTMLAttributes<HTMLUListElement> {\n id: string\n position?: Positions\n}\n\n/**\n * A component that allows the user to display a menu of navigation links.\n * @definition [Disclosure Nav](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/)\n * @definition [NavMenu Docs](https://cerberus.digitalu.design/react/nav-menu)\n *\n * @example\n * ```tsx\n * <NavMenuList id=\"nav-menu-list\" position=\"bottom\">\n * <NavMenuLink href=\"/home\">Home</NavMenuLink>\n * <NavMenuLink href=\"/about\">About</NavMenuLink>\n * </NavMenuList>\n * ```\n **/\nexport function NavMenuList(props: NavMenuListProps): JSX.Element {\n const { position, ...nativeProps } = props\n const { menuRef, expanded } = useNavMenuContext()\n const locationStyles = useMemo(\n () => getPosition(position ?? 'bottom'),\n [position],\n )\n\n return (\n <Show when={expanded}>\n <ul\n {...nativeProps}\n data-position={position ?? 'bottom'}\n className={cx(nativeProps.className, navListStyles)}\n ref={menuRef}\n style={locationStyles}\n />\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA6C;AAC7C,qBAAkC;AAClC,kBAAqB;AAErB,iBAAmB;AACnB,sBAAuB;AAyFjB;AAhFC,SAAS,YAAY,UAAwC;AAClE,QAAM,mBAAmB;AAAA,IACvB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,EACV;AACA,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO,EAAE,GAAG,kBAAkB,KAAK,MAAM,MAAM,OAAO;AAAA,IACxD,KAAK;AACH,aAAO,EAAE,GAAG,kBAAkB,KAAK,MAAM,OAAO,OAAO;AAAA,IACzD,KAAK;AACH,aAAO,EAAE,GAAG,kBAAkB,KAAK,OAAO;AAAA,IAC5C,KAAK;AACH,aAAO,EAAE,GAAG,kBAAkB,QAAQ,OAAO;AAAA,IAC/C;AACE,aAAO;AAAA,EACX;AACF;AAEA,IAAM,oBAAgB,wBAAO;AAAA,EAC3B,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,WAAW;AAAA,EACX,KAAK;AAAA,EACL,SAAS;AAAA,EACT,GAAG;AAAA,EACH,UAAU;AAAA,EACV,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,aAAa;AAAA,IACX,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB,yBAAyB;AAAA,EAC3B;AAAA,EACA,iBAAiB;AAAA,IACf,iBAAiB;AAAA,EACnB;AAAA,EACA,cAAc;AAAA,IACZ,iBAAiB;AAAA,EACnB;AAAA,EACA,eAAe;AAAA,IACb,iBAAiB;AAAA,EACnB;AAAA,EACA,gBAAgB;AAAA,IACd,iBAAiB;AAAA,EACnB;AACF,CAAC;AAoBM,SAAS,YAAY,OAAsC;AAChE,QAAM,EAAE,UAAU,GAAG,YAAY,IAAI;AACrC,QAAM,EAAE,SAAS,SAAS,QAAI,kCAAkB;AAChD,QAAM,qBAAiB;AAAA,IACrB,MAAM,YAAY,YAAY,QAAQ;AAAA,IACtC,CAAC,QAAQ;AAAA,EACX;AAEA,SACE,4CAAC,oBAAK,MAAM,UACV;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,iBAAe,YAAY;AAAA,MAC3B,eAAW,eAAG,YAAY,WAAW,aAAa;AAAA,MAClD,KAAK;AAAA,MACL,OAAO;AAAA;AAAA,EACT,GACF;AAEJ;","names":[]}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { useNavMenuContext } from "../context/navMenu.js";
|
|
6
6
|
import { Show } from "./Show.js";
|
|
7
|
-
import { cx } from "@cerberus
|
|
8
|
-
import { vstack } from "@cerberus
|
|
7
|
+
import { cx } from "@cerberus/styled-system/css.js";
|
|
8
|
+
import { vstack } from "@cerberus/styled-system/patterns.js";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
10
10
|
function getPosition(position) {
|
|
11
11
|
const defaultPositions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/NavMenuList.tsx"],"sourcesContent":["'use client'\n\nimport { useMemo, type HTMLAttributes } from 'react'\nimport { useNavMenuContext } from '../context/navMenu'\nimport { Show } from './Show'\nimport type { Positions } from '../types'\nimport { cx } from '@cerberus
|
|
1
|
+
{"version":3,"sources":["../../../src/components/NavMenuList.tsx"],"sourcesContent":["'use client'\n\nimport { useMemo, type HTMLAttributes } from 'react'\nimport { useNavMenuContext } from '../context/navMenu'\nimport { Show } from './Show'\nimport type { Positions } from '../types'\nimport { cx } from '@cerberus/styled-system/css'\nimport { vstack } from '@cerberus/styled-system/patterns'\n\ninterface GetPositionResult {\n left: string\n right: string\n top: string\n bottom: string\n}\n\nexport function getPosition(position: Positions): GetPositionResult {\n const defaultPositions = {\n left: 'auto',\n right: 'auto',\n top: 'auto',\n bottom: 'auto',\n }\n switch (position) {\n case 'right':\n return { ...defaultPositions, top: '0%', left: '105%' }\n case 'left':\n return { ...defaultPositions, top: '0%', right: '105%' }\n case 'bottom':\n return { ...defaultPositions, top: '110%' }\n case 'top':\n return { ...defaultPositions, bottom: '110%' }\n default:\n return defaultPositions\n }\n}\n\nconst navListStyles = vstack({\n alignItems: 'flex-start',\n bgColor: 'neutral.surface.100',\n boxShadow: 'lg',\n gap: '2',\n opacity: '0',\n p: '4',\n position: 'absolute',\n rounded: 'md',\n zIndex: 'dropdown',\n _motionSafe: {\n animationName: 'zoomIn',\n animationDelay: '100ms',\n animationDuration: '150ms',\n animationFillMode: 'both',\n animationTimingFunction: 'ease-in-out',\n },\n _positionBottom: {\n transformOrigin: 'top left',\n },\n _positionTop: {\n transformOrigin: 'bottom left',\n },\n _positionLeft: {\n transformOrigin: 'top right',\n },\n _positionRight: {\n transformOrigin: 'top left',\n },\n})\n\nexport interface NavMenuListProps extends HTMLAttributes<HTMLUListElement> {\n id: string\n position?: Positions\n}\n\n/**\n * A component that allows the user to display a menu of navigation links.\n * @definition [Disclosure Nav](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/)\n * @definition [NavMenu Docs](https://cerberus.digitalu.design/react/nav-menu)\n *\n * @example\n * ```tsx\n * <NavMenuList id=\"nav-menu-list\" position=\"bottom\">\n * <NavMenuLink href=\"/home\">Home</NavMenuLink>\n * <NavMenuLink href=\"/about\">About</NavMenuLink>\n * </NavMenuList>\n * ```\n **/\nexport function NavMenuList(props: NavMenuListProps): JSX.Element {\n const { position, ...nativeProps } = props\n const { menuRef, expanded } = useNavMenuContext()\n const locationStyles = useMemo(\n () => getPosition(position ?? 'bottom'),\n [position],\n )\n\n return (\n <Show when={expanded}>\n <ul\n {...nativeProps}\n data-position={position ?? 'bottom'}\n className={cx(nativeProps.className, navListStyles)}\n ref={menuRef}\n style={locationStyles}\n />\n </Show>\n )\n}\n"],"mappings":";;;AAEA,SAAS,eAAoC;AAC7C,SAAS,yBAAyB;AAClC,SAAS,YAAY;AAErB,SAAS,UAAU;AACnB,SAAS,cAAc;AAyFjB;AAhFC,SAAS,YAAY,UAAwC;AAClE,QAAM,mBAAmB;AAAA,IACvB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,EACV;AACA,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO,EAAE,GAAG,kBAAkB,KAAK,MAAM,MAAM,OAAO;AAAA,IACxD,KAAK;AACH,aAAO,EAAE,GAAG,kBAAkB,KAAK,MAAM,OAAO,OAAO;AAAA,IACzD,KAAK;AACH,aAAO,EAAE,GAAG,kBAAkB,KAAK,OAAO;AAAA,IAC5C,KAAK;AACH,aAAO,EAAE,GAAG,kBAAkB,QAAQ,OAAO;AAAA,IAC/C;AACE,aAAO;AAAA,EACX;AACF;AAEA,IAAM,gBAAgB,OAAO;AAAA,EAC3B,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,WAAW;AAAA,EACX,KAAK;AAAA,EACL,SAAS;AAAA,EACT,GAAG;AAAA,EACH,UAAU;AAAA,EACV,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,aAAa;AAAA,IACX,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB,yBAAyB;AAAA,EAC3B;AAAA,EACA,iBAAiB;AAAA,IACf,iBAAiB;AAAA,EACnB;AAAA,EACA,cAAc;AAAA,IACZ,iBAAiB;AAAA,EACnB;AAAA,EACA,eAAe;AAAA,IACb,iBAAiB;AAAA,EACnB;AAAA,EACA,gBAAgB;AAAA,IACd,iBAAiB;AAAA,EACnB;AACF,CAAC;AAoBM,SAAS,YAAY,OAAsC;AAChE,QAAM,EAAE,UAAU,GAAG,YAAY,IAAI;AACrC,QAAM,EAAE,SAAS,SAAS,IAAI,kBAAkB;AAChD,QAAM,iBAAiB;AAAA,IACrB,MAAM,YAAY,YAAY,QAAQ;AAAA,IACtC,CAAC,QAAQ;AAAA,EACX;AAEA,SACE,oBAAC,QAAK,MAAM,UACV;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,iBAAe,YAAY;AAAA,MAC3B,WAAW,GAAG,YAAY,WAAW,aAAa;AAAA,MAClD,KAAK;AAAA,MACL,OAAO;AAAA;AAAA,EACT,GACF;AAEJ;","names":[]}
|
|
@@ -25,8 +25,8 @@ __export(NavMenuTrigger_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(NavMenuTrigger_exports);
|
|
27
27
|
var import_react = require("react");
|
|
28
|
-
var import_css = require("@cerberus
|
|
29
|
-
var import_recipes = require("@cerberus
|
|
28
|
+
var import_css = require("@cerberus/styled-system/css.cjs");
|
|
29
|
+
var import_recipes = require("@cerberus/styled-system/recipes.cjs");
|
|
30
30
|
var import_nav_menu = require("../aria-helpers/nav-menu.aria.cjs");
|
|
31
31
|
var import_Show = require("./Show.cjs");
|
|
32
32
|
var import_navMenu = require("../context/navMenu.cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/NavMenuTrigger.tsx"],"sourcesContent":["'use client'\n\nimport {\n useCallback,\n type ButtonHTMLAttributes,\n type ElementType,\n type MouseEvent,\n} from 'react'\nimport { cx } from '@cerberus
|
|
1
|
+
{"version":3,"sources":["../../../src/components/NavMenuTrigger.tsx"],"sourcesContent":["'use client'\n\nimport {\n useCallback,\n type ButtonHTMLAttributes,\n type ElementType,\n type MouseEvent,\n} from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\nimport {\n createNavTriggerProps,\n type NavTriggerAriaValues,\n} from '../aria-helpers/nav-menu.aria'\nimport { Show } from './Show'\nimport type { ButtonProps } from './Button'\nimport { useNavMenuContext } from '../context/navMenu'\n\nexport interface NavMenuTriggerProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n ButtonProps,\n NavTriggerAriaValues {\n as?: ElementType\n}\n\n/**\n * A component that allows the user to trigger a navigation menu.\n * @definition [NavMenu Docs](https://cerberus.digitalu.design/react/nav-menu)\n * @example\n * ```tsx\n * <NavMenu>\n * <NavMenuTrigger controls=\"nav-menu-list\">\n * Menu\n * </NavMenuTrigger>\n * </NavMenu>\n * ```\n */\nexport function NavMenuTrigger(props: NavMenuTriggerProps): JSX.Element {\n const {\n as,\n palette,\n usage,\n shape,\n controls,\n expanded: propsExpanded,\n onClick,\n ...nativeProps\n } = props\n const { triggerRef, onToggle, expanded } = useNavMenuContext()\n const ariaProps = createNavTriggerProps({\n controls,\n expanded: propsExpanded ?? expanded,\n })\n const hasAs = Boolean(as)\n const AsSub: ElementType = as!\n\n const handleClick = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n if (onClick) return onClick(e)\n onToggle()\n },\n [onClick, onToggle],\n )\n\n return (\n <Show\n when={hasAs}\n fallback={\n <button\n {...nativeProps}\n {...ariaProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n onClick={handleClick}\n ref={triggerRef}\n >\n {props.children}\n </button>\n }\n >\n {hasAs && (\n <AsSub\n {...nativeProps}\n {...ariaProps}\n onClick={handleClick}\n ref={triggerRef}\n />\n )}\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAKO;AACP,iBAAmB;AACnB,qBAAuB;AACvB,sBAGO;AACP,kBAAqB;AAErB,qBAAkC;AAoD1B;AA/BD,SAAS,eAAe,OAAyC;AACtE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,EAAE,YAAY,UAAU,SAAS,QAAI,kCAAkB;AAC7D,QAAM,gBAAY,uCAAsB;AAAA,IACtC;AAAA,IACA,UAAU,iBAAiB;AAAA,EAC7B,CAAC;AACD,QAAM,QAAQ,QAAQ,EAAE;AACxB,QAAM,QAAqB;AAE3B,QAAM,kBAAc;AAAA,IAClB,CAAC,MAAqC;AACpC,UAAI;AAAS,eAAO,QAAQ,CAAC;AAC7B,eAAS;AAAA,IACX;AAAA,IACA,CAAC,SAAS,QAAQ;AAAA,EACpB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,UACE;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACH,GAAG;AAAA,UACJ,eAAW;AAAA,YACT,YAAY;AAAA,gBACZ,uBAAO;AAAA,cACL;AAAA,cACA;AAAA,cACA;AAAA,YACF,CAAC;AAAA,UACH;AAAA,UACA,SAAS;AAAA,UACT,KAAK;AAAA,UAEJ,gBAAM;AAAA;AAAA,MACT;AAAA,MAGD,mBACC;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACH,GAAG;AAAA,UACJ,SAAS;AAAA,UACT,KAAK;AAAA;AAAA,MACP;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import {
|
|
5
5
|
useCallback
|
|
6
6
|
} from "react";
|
|
7
|
-
import { cx } from "@cerberus
|
|
8
|
-
import { button } from "@cerberus
|
|
7
|
+
import { cx } from "@cerberus/styled-system/css.js";
|
|
8
|
+
import { button } from "@cerberus/styled-system/recipes.js";
|
|
9
9
|
import {
|
|
10
10
|
createNavTriggerProps
|
|
11
11
|
} from "../aria-helpers/nav-menu.aria.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/NavMenuTrigger.tsx"],"sourcesContent":["'use client'\n\nimport {\n useCallback,\n type ButtonHTMLAttributes,\n type ElementType,\n type MouseEvent,\n} from 'react'\nimport { cx } from '@cerberus
|
|
1
|
+
{"version":3,"sources":["../../../src/components/NavMenuTrigger.tsx"],"sourcesContent":["'use client'\n\nimport {\n useCallback,\n type ButtonHTMLAttributes,\n type ElementType,\n type MouseEvent,\n} from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\nimport {\n createNavTriggerProps,\n type NavTriggerAriaValues,\n} from '../aria-helpers/nav-menu.aria'\nimport { Show } from './Show'\nimport type { ButtonProps } from './Button'\nimport { useNavMenuContext } from '../context/navMenu'\n\nexport interface NavMenuTriggerProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n ButtonProps,\n NavTriggerAriaValues {\n as?: ElementType\n}\n\n/**\n * A component that allows the user to trigger a navigation menu.\n * @definition [NavMenu Docs](https://cerberus.digitalu.design/react/nav-menu)\n * @example\n * ```tsx\n * <NavMenu>\n * <NavMenuTrigger controls=\"nav-menu-list\">\n * Menu\n * </NavMenuTrigger>\n * </NavMenu>\n * ```\n */\nexport function NavMenuTrigger(props: NavMenuTriggerProps): JSX.Element {\n const {\n as,\n palette,\n usage,\n shape,\n controls,\n expanded: propsExpanded,\n onClick,\n ...nativeProps\n } = props\n const { triggerRef, onToggle, expanded } = useNavMenuContext()\n const ariaProps = createNavTriggerProps({\n controls,\n expanded: propsExpanded ?? expanded,\n })\n const hasAs = Boolean(as)\n const AsSub: ElementType = as!\n\n const handleClick = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n if (onClick) return onClick(e)\n onToggle()\n },\n [onClick, onToggle],\n )\n\n return (\n <Show\n when={hasAs}\n fallback={\n <button\n {...nativeProps}\n {...ariaProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n onClick={handleClick}\n ref={triggerRef}\n >\n {props.children}\n </button>\n }\n >\n {hasAs && (\n <AsSub\n {...nativeProps}\n {...ariaProps}\n onClick={handleClick}\n ref={triggerRef}\n />\n )}\n </Show>\n )\n}\n"],"mappings":";;;AAEA;AAAA,EACE;AAAA,OAIK;AACP,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,OAEK;AACP,SAAS,YAAY;AAErB,SAAS,yBAAyB;AAoD1B;AA/BD,SAAS,eAAe,OAAyC;AACtE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,EAAE,YAAY,UAAU,SAAS,IAAI,kBAAkB;AAC7D,QAAM,YAAY,sBAAsB;AAAA,IACtC;AAAA,IACA,UAAU,iBAAiB;AAAA,EAC7B,CAAC;AACD,QAAM,QAAQ,QAAQ,EAAE;AACxB,QAAM,QAAqB;AAE3B,QAAM,cAAc;AAAA,IAClB,CAAC,MAAqC;AACpC,UAAI;AAAS,eAAO,QAAQ,CAAC;AAC7B,eAAS;AAAA,IACX;AAAA,IACA,CAAC,SAAS,QAAQ;AAAA,EACpB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,UACE;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACH,GAAG;AAAA,UACJ,WAAW;AAAA,YACT,YAAY;AAAA,YACZ,OAAO;AAAA,cACL;AAAA,cACA;AAAA,cACA;AAAA,YACF,CAAC;AAAA,UACH;AAAA,UACA,SAAS;AAAA,UACT,KAAK;AAAA,UAEJ,gBAAM;AAAA;AAAA,MACT;AAAA,MAGD,mBACC;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACH,GAAG;AAAA,UACJ,SAAS;AAAA,UACT,KAAK;AAAA;AAAA,MACP;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/context/field.tsx
|
|
22
|
+
var field_exports = {};
|
|
23
|
+
__export(field_exports, {
|
|
24
|
+
Field: () => Field,
|
|
25
|
+
useFieldContext: () => useFieldContext
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(field_exports);
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var FieldContext = (0, import_react.createContext)(null);
|
|
31
|
+
function Field(props) {
|
|
32
|
+
const value = (0, import_react.useMemo)(
|
|
33
|
+
() => ({
|
|
34
|
+
disabled: props.disabled,
|
|
35
|
+
readonly: props.readonly,
|
|
36
|
+
required: props.required,
|
|
37
|
+
invalid: props.invalid
|
|
38
|
+
}),
|
|
39
|
+
[props.disabled, props.readonly, props.required, props.invalid]
|
|
40
|
+
);
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldContext.Provider, { value, children: props.children });
|
|
42
|
+
}
|
|
43
|
+
function useFieldContext() {
|
|
44
|
+
const context = (0, import_react.useContext)(FieldContext);
|
|
45
|
+
if (!context) {
|
|
46
|
+
throw new Error("useFieldContext must be used within a Field Provider.");
|
|
47
|
+
}
|
|
48
|
+
return context;
|
|
49
|
+
}
|
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
+
0 && (module.exports = {
|
|
52
|
+
Field,
|
|
53
|
+
useFieldContext
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=field.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/context/field.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useContext,\n useMemo,\n type PropsWithChildren,\n} from 'react'\n\nexport interface FieldContextValue {\n disabled?: boolean\n readonly?: boolean\n required?: boolean\n invalid?: boolean\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\n\nexport function Field(\n props: PropsWithChildren<FieldContextValue>,\n): JSX.Element {\n const value = useMemo(\n () => ({\n disabled: props.disabled,\n readonly: props.readonly,\n required: props.required,\n invalid: props.invalid,\n }),\n [props.disabled, props.readonly, props.required, props.invalid],\n )\n\n return (\n <FieldContext.Provider value={value}>\n {props.children}\n </FieldContext.Provider>\n )\n}\n\nexport function useFieldContext(): FieldContextValue {\n const context = useContext(FieldContext)\n if (!context) {\n throw new Error('useFieldContext must be used within a Field Provider.')\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAKO;AAyBH;AAhBJ,IAAM,mBAAe,4BAAwC,IAAI;AAE1D,SAAS,MACd,OACa;AACb,QAAM,YAAQ;AAAA,IACZ,OAAO;AAAA,MACL,UAAU,MAAM;AAAA,MAChB,UAAU,MAAM;AAAA,MAChB,UAAU,MAAM;AAAA,MAChB,SAAS,MAAM;AAAA,IACjB;AAAA,IACA,CAAC,MAAM,UAAU,MAAM,UAAU,MAAM,UAAU,MAAM,OAAO;AAAA,EAChE;AAEA,SACE,4CAAC,aAAa,UAAb,EAAsB,OACpB,gBAAM,UACT;AAEJ;AAEO,SAAS,kBAAqC;AACnD,QAAM,cAAU,yBAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACzE;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/context/field.tsx
|
|
4
|
+
import {
|
|
5
|
+
createContext,
|
|
6
|
+
useContext,
|
|
7
|
+
useMemo
|
|
8
|
+
} from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var FieldContext = createContext(null);
|
|
11
|
+
function Field(props) {
|
|
12
|
+
const value = useMemo(
|
|
13
|
+
() => ({
|
|
14
|
+
disabled: props.disabled,
|
|
15
|
+
readonly: props.readonly,
|
|
16
|
+
required: props.required,
|
|
17
|
+
invalid: props.invalid
|
|
18
|
+
}),
|
|
19
|
+
[props.disabled, props.readonly, props.required, props.invalid]
|
|
20
|
+
);
|
|
21
|
+
return /* @__PURE__ */ jsx(FieldContext.Provider, { value, children: props.children });
|
|
22
|
+
}
|
|
23
|
+
function useFieldContext() {
|
|
24
|
+
const context = useContext(FieldContext);
|
|
25
|
+
if (!context) {
|
|
26
|
+
throw new Error("useFieldContext must be used within a Field Provider.");
|
|
27
|
+
}
|
|
28
|
+
return context;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
Field,
|
|
32
|
+
useFieldContext
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/context/field.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useContext,\n useMemo,\n type PropsWithChildren,\n} from 'react'\n\nexport interface FieldContextValue {\n disabled?: boolean\n readonly?: boolean\n required?: boolean\n invalid?: boolean\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\n\nexport function Field(\n props: PropsWithChildren<FieldContextValue>,\n): JSX.Element {\n const value = useMemo(\n () => ({\n disabled: props.disabled,\n readonly: props.readonly,\n required: props.required,\n invalid: props.invalid,\n }),\n [props.disabled, props.readonly, props.required, props.invalid],\n )\n\n return (\n <FieldContext.Provider value={value}>\n {props.children}\n </FieldContext.Provider>\n )\n}\n\nexport function useFieldContext(): FieldContextValue {\n const context = useContext(FieldContext)\n if (!context) {\n throw new Error('useFieldContext must be used within a Field Provider.')\n }\n return context\n}\n"],"mappings":";;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAyBH;AAhBJ,IAAM,eAAe,cAAwC,IAAI;AAE1D,SAAS,MACd,OACa;AACb,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL,UAAU,MAAM;AAAA,MAChB,UAAU,MAAM;AAAA,MAChB,UAAU,MAAM;AAAA,MAChB,SAAS,MAAM;AAAA,IACjB;AAAA,IACA,CAAC,MAAM,UAAU,MAAM,UAAU,MAAM,UAAU,MAAM,OAAO;AAAA,EAChE;AAEA,SACE,oBAAC,aAAa,UAAb,EAAsB,OACpB,gBAAM,UACT;AAEJ;AAEO,SAAS,kBAAqC;AACnD,QAAM,UAAU,WAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACzE;AACA,SAAO;AACT;","names":[]}
|
|
@@ -25,7 +25,7 @@ __export(navMenu_exports, {
|
|
|
25
25
|
useNavMenuContext: () => useNavMenuContext
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(navMenu_exports);
|
|
28
|
-
var import_css = require("@cerberus
|
|
28
|
+
var import_css = require("@cerberus/styled-system/css.cjs");
|
|
29
29
|
var import_react = require("react");
|
|
30
30
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
31
|
var NavMenuContext = (0, import_react.createContext)(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/context/navMenu.tsx"],"sourcesContent":["'use client'\n\nimport { css } from '@cerberus
|
|
1
|
+
{"version":3,"sources":["../../../src/context/navMenu.tsx"],"sourcesContent":["'use client'\n\nimport { css } from '@cerberus/styled-system/css'\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type RefObject,\n} from 'react'\n\nexport type NavTriggerRef = RefObject<HTMLButtonElement>\nexport type NavMenuRef = RefObject<HTMLUListElement>\n\nexport interface NavMenuContextValue {\n triggerRef: NavTriggerRef | null\n menuRef: NavMenuRef | null\n expanded: boolean\n onToggle: () => void\n}\n\nconst NavMenuContext = createContext<NavMenuContextValue | null>(null)\n\nexport function NavMenu(props: PropsWithChildren): JSX.Element {\n const triggerRef = useRef<HTMLButtonElement>(null)\n const menuRef = useRef<HTMLUListElement>(null)\n const [expanded, setExpanded] = useState<boolean>(false)\n\n const handleToggle = useCallback(() => {\n setExpanded((prev) => !prev)\n }, [])\n\n const value = useMemo(\n () => ({\n triggerRef,\n menuRef,\n expanded,\n onToggle: handleToggle,\n }),\n [expanded, handleToggle],\n )\n\n return (\n <NavMenuContext.Provider value={value}>\n <nav\n className={css({\n position: 'relative',\n })}\n >\n {props.children}\n </nav>\n </NavMenuContext.Provider>\n )\n}\n\nexport function useNavMenuContext(): NavMenuContextValue {\n const context = useContext(NavMenuContext)\n if (!context) {\n throw new Error('useNavMenuContext must be used within a NavMenu.')\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAoB;AACpB,mBASO;AAmCD;AAvBN,IAAM,qBAAiB,4BAA0C,IAAI;AAE9D,SAAS,QAAQ,OAAuC;AAC7D,QAAM,iBAAa,qBAA0B,IAAI;AACjD,QAAM,cAAU,qBAAyB,IAAI;AAC7C,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAkB,KAAK;AAEvD,QAAM,mBAAe,0BAAY,MAAM;AACrC,gBAAY,CAAC,SAAS,CAAC,IAAI;AAAA,EAC7B,GAAG,CAAC,CAAC;AAEL,QAAM,YAAQ;AAAA,IACZ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,IACZ;AAAA,IACA,CAAC,UAAU,YAAY;AAAA,EACzB;AAEA,SACE,4CAAC,eAAe,UAAf,EAAwB,OACvB;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,gBAAI;AAAA,QACb,UAAU;AAAA,MACZ,CAAC;AAAA,MAEA,gBAAM;AAAA;AAAA,EACT,GACF;AAEJ;AAEO,SAAS,oBAAyC;AACvD,QAAM,cAAU,yBAAW,cAAc;AACzC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/context/navMenu.tsx"],"sourcesContent":["'use client'\n\nimport { css } from '@cerberus
|
|
1
|
+
{"version":3,"sources":["../../../src/context/navMenu.tsx"],"sourcesContent":["'use client'\n\nimport { css } from '@cerberus/styled-system/css'\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type RefObject,\n} from 'react'\n\nexport type NavTriggerRef = RefObject<HTMLButtonElement>\nexport type NavMenuRef = RefObject<HTMLUListElement>\n\nexport interface NavMenuContextValue {\n triggerRef: NavTriggerRef | null\n menuRef: NavMenuRef | null\n expanded: boolean\n onToggle: () => void\n}\n\nconst NavMenuContext = createContext<NavMenuContextValue | null>(null)\n\nexport function NavMenu(props: PropsWithChildren): JSX.Element {\n const triggerRef = useRef<HTMLButtonElement>(null)\n const menuRef = useRef<HTMLUListElement>(null)\n const [expanded, setExpanded] = useState<boolean>(false)\n\n const handleToggle = useCallback(() => {\n setExpanded((prev) => !prev)\n }, [])\n\n const value = useMemo(\n () => ({\n triggerRef,\n menuRef,\n expanded,\n onToggle: handleToggle,\n }),\n [expanded, handleToggle],\n )\n\n return (\n <NavMenuContext.Provider value={value}>\n <nav\n className={css({\n position: 'relative',\n })}\n >\n {props.children}\n </nav>\n </NavMenuContext.Provider>\n )\n}\n\nexport function useNavMenuContext(): NavMenuContextValue {\n const context = useContext(NavMenuContext)\n if (!context) {\n throw new Error('useNavMenuContext must be used within a NavMenu.')\n }\n return context\n}\n"],"mappings":";;;AAEA,SAAS,WAAW;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAmCD;AAvBN,IAAM,iBAAiB,cAA0C,IAAI;AAE9D,SAAS,QAAQ,OAAuC;AAC7D,QAAM,aAAa,OAA0B,IAAI;AACjD,QAAM,UAAU,OAAyB,IAAI;AAC7C,QAAM,CAAC,UAAU,WAAW,IAAI,SAAkB,KAAK;AAEvD,QAAM,eAAe,YAAY,MAAM;AACrC,gBAAY,CAAC,SAAS,CAAC,IAAI;AAAA,EAC7B,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,IACZ;AAAA,IACA,CAAC,UAAU,YAAY;AAAA,EACzB;AAEA,SACE,oBAAC,eAAe,UAAf,EAAwB,OACvB;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,IAAI;AAAA,QACb,UAAU;AAAA,MACZ,CAAC;AAAA,MAEA,gBAAM;AAAA;AAAA,EACT,GACF;AAEJ;AAEO,SAAS,oBAAyC;AACvD,QAAM,UAAU,WAAW,cAAc;AACzC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=global.d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/build/legacy/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ __reExport(src_exports, require("./components/NavMenuTrigger.cjs"), module.expor
|
|
|
22
22
|
__reExport(src_exports, require("./components/NavMenuList.cjs"), module.exports);
|
|
23
23
|
__reExport(src_exports, require("./components/NavMenuLink.cjs"), module.exports);
|
|
24
24
|
__reExport(src_exports, require("./components/Show.cjs"), module.exports);
|
|
25
|
+
__reExport(src_exports, require("./context/field.cjs"), module.exports);
|
|
25
26
|
__reExport(src_exports, require("./context/navMenu.cjs"), module.exports);
|
|
26
27
|
__reExport(src_exports, require("./context/theme.cjs"), module.exports);
|
|
27
28
|
__reExport(src_exports, require("./hooks/useTheme.cjs"), module.exports);
|
|
@@ -34,6 +35,7 @@ __reExport(src_exports, require("./types.cjs"), module.exports);
|
|
|
34
35
|
...require("./components/NavMenuList.cjs"),
|
|
35
36
|
...require("./components/NavMenuLink.cjs"),
|
|
36
37
|
...require("./components/Show.cjs"),
|
|
38
|
+
...require("./context/field.cjs"),
|
|
37
39
|
...require("./context/navMenu.cjs"),
|
|
38
40
|
...require("./context/theme.cjs"),
|
|
39
41
|
...require("./hooks/useTheme.cjs"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// components\n\nexport * from './components/Button'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAEA,wBAAc,oCAFd;AAGA,wBAAc,4CAHd;AAIA,wBAAc,yCAJd;AAKA,wBAAc,yCALd;AAMA,wBAAc,kCANd;AAUA,wBAAc,
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// components\n\nexport * from './components/Button'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAEA,wBAAc,oCAFd;AAGA,wBAAc,4CAHd;AAIA,wBAAc,yCAJd;AAKA,wBAAc,yCALd;AAMA,wBAAc,kCANd;AAUA,wBAAc,gCAVd;AAWA,wBAAc,kCAXd;AAYA,wBAAc,gCAZd;AAgBA,wBAAc,iCAhBd;AAoBA,wBAAc,6CApBd;AAwBA,wBAAc,wBAxBd;","names":[]}
|
package/build/legacy/index.d.cts
CHANGED
|
@@ -9,6 +9,9 @@ export { NavMenuLink } from './_tsup-dts-rollup';
|
|
|
9
9
|
export { NavMenuLinkProps } from './_tsup-dts-rollup';
|
|
10
10
|
export { Show } from './_tsup-dts-rollup';
|
|
11
11
|
export { ShowProps } from './_tsup-dts-rollup';
|
|
12
|
+
export { Field } from './_tsup-dts-rollup';
|
|
13
|
+
export { useFieldContext } from './_tsup-dts-rollup';
|
|
14
|
+
export { FieldContextValue } from './_tsup-dts-rollup';
|
|
12
15
|
export { NavMenu } from './_tsup-dts-rollup';
|
|
13
16
|
export { useNavMenuContext } from './_tsup-dts-rollup';
|
|
14
17
|
export { NavTriggerRef } from './_tsup-dts-rollup';
|
package/build/legacy/index.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export { NavMenuLink } from './_tsup-dts-rollup';
|
|
|
9
9
|
export { NavMenuLinkProps } from './_tsup-dts-rollup';
|
|
10
10
|
export { Show } from './_tsup-dts-rollup';
|
|
11
11
|
export { ShowProps } from './_tsup-dts-rollup';
|
|
12
|
+
export { Field } from './_tsup-dts-rollup';
|
|
13
|
+
export { useFieldContext } from './_tsup-dts-rollup';
|
|
14
|
+
export { FieldContextValue } from './_tsup-dts-rollup';
|
|
12
15
|
export { NavMenu } from './_tsup-dts-rollup';
|
|
13
16
|
export { useNavMenuContext } from './_tsup-dts-rollup';
|
|
14
17
|
export { NavTriggerRef } from './_tsup-dts-rollup';
|
package/build/legacy/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./components/NavMenuTrigger.js";
|
|
|
4
4
|
export * from "./components/NavMenuList.js";
|
|
5
5
|
export * from "./components/NavMenuLink.js";
|
|
6
6
|
export * from "./components/Show.js";
|
|
7
|
+
export * from "./context/field.js";
|
|
7
8
|
export * from "./context/navMenu.js";
|
|
8
9
|
export * from "./context/theme.js";
|
|
9
10
|
export * from "./hooks/useTheme.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// components\n\nexport * from './components/Button'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AACd,cAAc;AAId,cAAc;AAId,cAAc;AAId,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// components\n\nexport * from './components/Button'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AAId,cAAc;AAId,cAAc;","names":[]}
|
|
@@ -38,6 +38,19 @@ declare type DefaultThemes = 'cerberus';
|
|
|
38
38
|
export { DefaultThemes }
|
|
39
39
|
export { DefaultThemes as DefaultThemes_alias_1 }
|
|
40
40
|
|
|
41
|
+
declare function Field(props: PropsWithChildren<FieldContextValue>): JSX.Element;
|
|
42
|
+
export { Field }
|
|
43
|
+
export { Field as Field_alias_1 }
|
|
44
|
+
|
|
45
|
+
declare interface FieldContextValue {
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
readonly?: boolean;
|
|
48
|
+
required?: boolean;
|
|
49
|
+
invalid?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export { FieldContextValue }
|
|
52
|
+
export { FieldContextValue as FieldContextValue_alias_1 }
|
|
53
|
+
|
|
41
54
|
declare function getPosition(position: Positions): GetPositionResult;
|
|
42
55
|
export { getPosition }
|
|
43
56
|
export { getPosition as getPosition_alias_1 }
|
|
@@ -193,6 +206,10 @@ declare function ThemeProvider(props: PropsWithChildren<unknown>): JSX.Element;
|
|
|
193
206
|
export { ThemeProvider }
|
|
194
207
|
export { ThemeProvider as ThemeProvider_alias_1 }
|
|
195
208
|
|
|
209
|
+
declare function useFieldContext(): FieldContextValue;
|
|
210
|
+
export { useFieldContext }
|
|
211
|
+
export { useFieldContext as useFieldContext_alias_1 }
|
|
212
|
+
|
|
196
213
|
declare function useNavMenuContext(): NavMenuContextValue;
|
|
197
214
|
export { useNavMenuContext }
|
|
198
215
|
export { useNavMenuContext as useNavMenuContext_alias_1 }
|
|
@@ -38,6 +38,19 @@ declare type DefaultThemes = 'cerberus';
|
|
|
38
38
|
export { DefaultThemes }
|
|
39
39
|
export { DefaultThemes as DefaultThemes_alias_1 }
|
|
40
40
|
|
|
41
|
+
declare function Field(props: PropsWithChildren<FieldContextValue>): JSX.Element;
|
|
42
|
+
export { Field }
|
|
43
|
+
export { Field as Field_alias_1 }
|
|
44
|
+
|
|
45
|
+
declare interface FieldContextValue {
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
readonly?: boolean;
|
|
48
|
+
required?: boolean;
|
|
49
|
+
invalid?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export { FieldContextValue }
|
|
52
|
+
export { FieldContextValue as FieldContextValue_alias_1 }
|
|
53
|
+
|
|
41
54
|
declare function getPosition(position: Positions): GetPositionResult;
|
|
42
55
|
export { getPosition }
|
|
43
56
|
export { getPosition as getPosition_alias_1 }
|
|
@@ -193,6 +206,10 @@ declare function ThemeProvider(props: PropsWithChildren<unknown>): JSX.Element;
|
|
|
193
206
|
export { ThemeProvider }
|
|
194
207
|
export { ThemeProvider as ThemeProvider_alias_1 }
|
|
195
208
|
|
|
209
|
+
declare function useFieldContext(): FieldContextValue;
|
|
210
|
+
export { useFieldContext }
|
|
211
|
+
export { useFieldContext as useFieldContext_alias_1 }
|
|
212
|
+
|
|
196
213
|
declare function useNavMenuContext(): NavMenuContextValue;
|
|
197
214
|
export { useNavMenuContext }
|
|
198
215
|
export { useNavMenuContext as useNavMenuContext_alias_1 }
|