@stokelp/ui 2.104.1 → 2.105.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/app/mobile-navigation/MobileNavigation.cjs +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.d.ts +4 -4
- package/dist/components/app/mobile-navigation/MobileNavigation.js +5 -5
- package/dist/components/app/mobile-navigation/MobileNavigation.js.map +1 -1
- package/dist/components/app/navigation/AppNavigation.cjs +1 -1
- package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
- package/dist/components/app/navigation/AppNavigation.d.ts +10 -10
- package/dist/components/app/navigation/AppNavigation.js +12 -12
- package/dist/components/app/navigation/AppNavigation.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.d.ts +4 -4
- package/dist/components/breadcrumb/Breadcrumb.js +5 -5
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/button/Button.cjs.map +1 -1
- package/dist/components/button/Button.d.ts +11 -11
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.cjs +1 -1
- package/dist/components/checkbox-card/CheckboxCard.cjs.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.d.ts +4 -4
- package/dist/components/checkbox-card/CheckboxCard.js +6 -6
- package/dist/components/checkbox-card/CheckboxCard.js.map +1 -1
- package/dist/components/drawer/Drawer.cjs +1 -1
- package/dist/components/drawer/Drawer.cjs.map +1 -1
- package/dist/components/drawer/Drawer.js +2 -4
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/form/FormControl.cjs.map +1 -1
- package/dist/components/form/FormControl.d.ts +2 -2
- package/dist/components/form/FormControl.js.map +1 -1
- package/dist/components/form/FormHelperText.cjs.map +1 -1
- package/dist/components/form/FormHelperText.d.ts +2 -2
- package/dist/components/form/FormHelperText.js.map +1 -1
- package/dist/components/form/FormLabel.cjs.map +1 -1
- package/dist/components/form/FormLabel.d.ts +2 -2
- package/dist/components/form/FormLabel.js.map +1 -1
- package/dist/components/input/HighlightedInput.d.ts +1 -1
- package/dist/components/input/Input.cjs.map +1 -1
- package/dist/components/input/Input.d.ts +2 -2
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input/InputGroup.cjs.map +1 -1
- package/dist/components/input/InputGroup.d.ts +2 -2
- package/dist/components/input/InputGroup.js.map +1 -1
- package/dist/components/table/Table.cjs +1 -1
- package/dist/components/table/Table.cjs.map +1 -1
- package/dist/components/table/Table.d.ts +11 -11
- package/dist/components/table/Table.js +19 -19
- package/dist/components/table/Table.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utils/slots.cjs"),n=require("../../icon/Icon.cjs");let r=require("@stokelp/styled-system/jsx"),i=require("@stokelp/styled-system/recipes");var a=e.__exportAll({Item:()=>
|
|
1
|
+
"use client";const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utils/slots.cjs"),n=require("../../icon/Icon.cjs");let r=require("@stokelp/styled-system/jsx"),i=require("@stokelp/styled-system/recipes");var a=e.__exportAll({Item:()=>u,ItemIcon:()=>d,ItemLabel:()=>f,Root:()=>l}),{withProvider:o,withContext:s}=t.createStyleContext(i.mobileNavigation,{dataAttr:!0}),c=e=>(0,r.styled)(e),l=o(c(`nav`),`root`),u=s(c(`a`),`item`),d=s(n.Icon,`itemIcon`,{defaultProps:{size:`sm`}}),f=s(c(`span`),`itemLabel`);Object.defineProperty(exports,"MobileNavigation_exports",{enumerable:!0,get:function(){return a}});
|
|
2
2
|
//# sourceMappingURL=MobileNavigation.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileNavigation.cjs","names":[],"sources":["../../../../src/components/app/mobile-navigation/MobileNavigation.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { mobileNavigation } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Icon } from '~/components/icon/Icon'\nimport { ComponentProps } from 'react'\n\nconst { withProvider, withContext } = createStyleContext(mobileNavigation, {\n dataAttr: true,\n})\n\nexport const Root = withProvider(
|
|
1
|
+
{"version":3,"file":"MobileNavigation.cjs","names":[],"sources":["../../../../src/components/app/mobile-navigation/MobileNavigation.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { mobileNavigation } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { createStyleContext } from '~/utils/slots'\nimport { Icon } from '~/components/icon/Icon'\nimport { ComponentProps, type JSX } from 'react'\n\nconst { withProvider, withContext } = createStyleContext(mobileNavigation, {\n dataAttr: true,\n})\n\n// See Table.tsx for why we pin the literal tag.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nexport const Root = withProvider(styledTag('nav'), 'root')\nexport const Item = withContext(styledTag('a'), 'item')\nexport const ItemIcon = withContext(Icon, 'itemIcon', {\n defaultProps: {\n size: 'sm',\n },\n})\nexport const ItemLabel = withContext(styledTag('span'), 'itemLabel')\n\nexport interface MobileNavigationProps extends ComponentProps<typeof Root> {}\nexport interface MobileNavigationItemProps extends ComponentProps<typeof Item> {}\nexport interface MobileNavigationItemIconProps extends ComponentProps<typeof ItemIcon> {}\nexport interface MobileNavigationItemLabelProps extends ComponentProps<typeof ItemLabel> {}\n"],"mappings":"mTAOM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,iBAAkB,CACzE,SAAU,EACZ,CAAC,EAGK,EAAoD,IAAA,EAAA,EAAA,QACjD,CAAG,EAEC,EAAO,EAAa,EAAU,KAAK,EAAG,MAAM,EAC5C,EAAO,EAAY,EAAU,GAAG,EAAG,MAAM,EACzC,EAAW,EAAY,EAAA,KAAM,WAAY,CACpD,aAAc,CACZ,KAAM,IACR,CACF,CAAC,EACY,EAAY,EAAY,EAAU,MAAM,EAAG,WAAW"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
1
2
|
import { ComponentProps, FC } from 'react';
|
|
2
3
|
import { ComponentVariants } from '../../../utils/slots';
|
|
3
|
-
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
4
4
|
import { MobileNavigationRecipe } from '@stokelp/styled-system/recipes';
|
|
5
|
-
export declare const Root: ComponentVariants<StyledComponent<
|
|
6
|
-
export declare const Item: StyledComponent<
|
|
5
|
+
export declare const Root: ComponentVariants<StyledComponent<"nav", {}>, MobileNavigationRecipe>;
|
|
6
|
+
export declare const Item: StyledComponent<"a", {}>;
|
|
7
7
|
export declare const ItemIcon: FC<any>;
|
|
8
|
-
export declare const ItemLabel: StyledComponent<
|
|
8
|
+
export declare const ItemLabel: StyledComponent<"span", {}>;
|
|
9
9
|
export interface MobileNavigationProps extends ComponentProps<typeof Root> {
|
|
10
10
|
}
|
|
11
11
|
export interface MobileNavigationItemProps extends ComponentProps<typeof Item> {
|
|
@@ -6,11 +6,11 @@ import { styled as r } from "@stokelp/styled-system/jsx";
|
|
|
6
6
|
import { mobileNavigation as i } from "@stokelp/styled-system/recipes";
|
|
7
7
|
//#region src/components/app/mobile-navigation/MobileNavigation.tsx
|
|
8
8
|
var a = /* @__PURE__ */ e({
|
|
9
|
-
Item: () =>
|
|
10
|
-
ItemIcon: () =>
|
|
11
|
-
ItemLabel: () =>
|
|
12
|
-
Root: () =>
|
|
13
|
-
}), { withProvider: o, withContext: s } = t(i, { dataAttr: !0 }), c =
|
|
9
|
+
Item: () => u,
|
|
10
|
+
ItemIcon: () => d,
|
|
11
|
+
ItemLabel: () => f,
|
|
12
|
+
Root: () => l
|
|
13
|
+
}), { withProvider: o, withContext: s } = t(i, { dataAttr: !0 }), c = (e) => r(e), l = o(c("nav"), "root"), u = s(c("a"), "item"), d = s(n, "itemIcon", { defaultProps: { size: "sm" } }), f = s(c("span"), "itemLabel");
|
|
14
14
|
//#endregion
|
|
15
15
|
export { a as MobileNavigation_exports };
|
|
16
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileNavigation.js","names":[],"sources":["../../../../src/components/app/mobile-navigation/MobileNavigation.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { mobileNavigation } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Icon } from '~/components/icon/Icon'\nimport { ComponentProps } from 'react'\n\nconst { withProvider, withContext } = createStyleContext(mobileNavigation, {\n dataAttr: true,\n})\n\nexport const Root = withProvider(
|
|
1
|
+
{"version":3,"file":"MobileNavigation.js","names":[],"sources":["../../../../src/components/app/mobile-navigation/MobileNavigation.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { mobileNavigation } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { createStyleContext } from '~/utils/slots'\nimport { Icon } from '~/components/icon/Icon'\nimport { ComponentProps, type JSX } from 'react'\n\nconst { withProvider, withContext } = createStyleContext(mobileNavigation, {\n dataAttr: true,\n})\n\n// See Table.tsx for why we pin the literal tag.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nexport const Root = withProvider(styledTag('nav'), 'root')\nexport const Item = withContext(styledTag('a'), 'item')\nexport const ItemIcon = withContext(Icon, 'itemIcon', {\n defaultProps: {\n size: 'sm',\n },\n})\nexport const ItemLabel = withContext(styledTag('span'), 'itemLabel')\n\nexport interface MobileNavigationProps extends ComponentProps<typeof Root> {}\nexport interface MobileNavigationItemProps extends ComponentProps<typeof Item> {}\nexport interface MobileNavigationItemIconProps extends ComponentProps<typeof ItemIcon> {}\nexport interface MobileNavigationItemLabelProps extends ComponentProps<typeof ItemLabel> {}\n"],"mappings":";;;;;;;;;;;;IAOM,EAAE,iBAAc,mBAAgB,EAAmB,GAAkB,EACzE,UAAU,GACZ,CAAC,GAGK,KAAoD,MACxD,EAAO,CAAG,GAEC,IAAO,EAAa,EAAU,KAAK,GAAG,MAAM,GAC5C,IAAO,EAAY,EAAU,GAAG,GAAG,MAAM,GACzC,IAAW,EAAY,GAAM,YAAY,EACpD,cAAc,EACZ,MAAM,KACR,EACF,CAAC,GACY,IAAY,EAAY,EAAU,MAAM,GAAG,WAAW"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utils/slots.cjs"),n=require("../../tag/Tag.cjs"),r=require("../../icon/Icon.cjs"),i=require("../../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs");let a=require("@stokelp/styled-system/jsx"),o=require("@stokelp/styled-system/recipes"),s=require("react/jsx-runtime");var c=e.__exportAll({Body:()=>
|
|
1
|
+
"use client";const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utils/slots.cjs"),n=require("../../tag/Tag.cjs"),r=require("../../icon/Icon.cjs"),i=require("../../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs");let a=require("@stokelp/styled-system/jsx"),o=require("@stokelp/styled-system/recipes"),s=require("react/jsx-runtime");var c=e.__exportAll({Body:()=>m,Footer:()=>x,Header:()=>p,Item:()=>h,ItemAlpha:()=>b,ItemContent:()=>_,ItemIcon:()=>y,ItemLabel:()=>v,ItemSubItems:()=>g,MiniaturizeTrigger:()=>S,Root:()=>f}),{withProvider:l,withContext:u}=t.createStyleContext(o.appNavigation,{dataAttr:!0}),d=e=>(0,a.styled)(e),f=l(d(`nav`),`root`,{defaultProps:{}}),p=u(d(`header`),`header`),m=u(d(`main`),`body`),h=u(d(`div`),`item`),g=u(d(`div`),`itemSubItems`),_=u(d(`div`),`itemContent`),v=u(d(`p`),`itemLabel`),y=u(r.Icon,`itemIcon`,{defaultProps:{size:`sm`}}),b=u(n.Tag,`itemAlpha`,{defaultProps:{severity:`success`}}),x=u(d(`footer`),`footer`),S=u(d(`div`),`miniaturizeTrigger`,{defaultProps:{onClick:e=>{e.preventDefault();let t=localStorage.getItem(`isMiniaturizeNav`)===`closed`?`open`:`closed`;localStorage.setItem(`isMiniaturizeNav`,t),e.currentTarget.setAttribute(`data-state`,t),window.dispatchEvent(new Event(`storage`))},className:`app-navigation__miniaturizeTrigger`,"data-state":typeof localStorage<`u`&&localStorage.getItem(`isMiniaturizeNav`)||`open`,children:(0,s.jsx)(r.Icon,{children:(0,s.jsx)(i.default,{})})}});Object.defineProperty(exports,"AppNavigation_exports",{enumerable:!0,get:function(){return c}});
|
|
2
2
|
//# sourceMappingURL=AppNavigation.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppNavigation.cjs","names":[],"sources":["../../../../src/components/app/navigation/AppNavigation.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { appNavigation } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Icon } from '~/components/icon/Icon'\nimport { ComponentProps, type MouseEvent } from 'react'\nimport { ArrowLeftCircleIcon } from '@heroicons/react/24/outline'\nimport { Tag } from '~/components'\n\nconst { withProvider, withContext } = createStyleContext(appNavigation, {\n dataAttr: true,\n})\n\nexport const Root = withProvider(
|
|
1
|
+
{"version":3,"file":"AppNavigation.cjs","names":[],"sources":["../../../../src/components/app/navigation/AppNavigation.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { appNavigation } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { createStyleContext } from '~/utils/slots'\nimport { Icon } from '~/components/icon/Icon'\nimport { ComponentProps, type JSX, type MouseEvent } from 'react'\nimport { ArrowLeftCircleIcon } from '@heroicons/react/24/outline'\nimport { Tag } from '~/components'\n\nconst { withProvider, withContext } = createStyleContext(appNavigation, {\n dataAttr: true,\n})\n\n// See Table.tsx for why we wrap `styled(tag)` to pin the literal tag.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nexport const Root = withProvider(styledTag('nav'), 'root', {\n defaultProps: {\n //'data-state': localStorage.getItem('isMiniaturizeNav') || 'open',\n },\n})\nexport const Header = withContext(styledTag('header'), 'header')\nexport const Body = withContext(styledTag('main'), 'body')\n\nexport const Item = withContext(styledTag('div'), 'item')\nexport const ItemSubItems = withContext(styledTag('div'), 'itemSubItems')\nexport const ItemContent = withContext(styledTag('div'), 'itemContent')\nexport const ItemLabel = withContext(styledTag('p'), 'itemLabel')\nexport const ItemIcon = withContext(Icon, 'itemIcon', {\n defaultProps: {\n size: 'sm',\n },\n})\nexport const ItemAlpha = withContext(Tag, 'itemAlpha', {\n defaultProps: {\n severity: 'success',\n },\n})\n\nexport const Footer = withContext(styledTag('footer'), 'footer')\n\nexport const MiniaturizeTrigger = withContext(styledTag('div'), 'miniaturizeTrigger', {\n defaultProps: {\n onClick: (e: MouseEvent<HTMLDivElement>) => {\n e.preventDefault()\n const currentState = localStorage.getItem('isMiniaturizeNav')\n const newState = currentState === 'closed' ? 'open' : 'closed'\n localStorage.setItem('isMiniaturizeNav', newState)\n e.currentTarget.setAttribute('data-state', newState)\n window.dispatchEvent(new Event('storage'))\n },\n className: 'app-navigation__miniaturizeTrigger',\n ...{\n 'data-state': typeof localStorage !== 'undefined' ? localStorage.getItem('isMiniaturizeNav') || 'open' : 'open',\n },\n children: (\n <Icon>\n <ArrowLeftCircleIcon />\n </Icon>\n ),\n },\n})\n\nexport interface AppNavigationProps extends ComponentProps<typeof Root> {}\nexport interface AppNavigationHeaderProps extends ComponentProps<typeof Header> {}\nexport interface AppNavigationBodyProps extends ComponentProps<typeof Body> {}\nexport interface AppNavigationItemProps extends ComponentProps<typeof Item> {}\nexport interface AppNavigationItemSubItemsProps extends ComponentProps<typeof ItemSubItems> {}\nexport interface AppNavigationItemContentProps extends ComponentProps<typeof ItemContent> {}\nexport type AppNavigationItemLabelProps = ComponentProps<typeof ItemLabel>\nexport interface AppNavigationItemIconProps extends ComponentProps<typeof ItemIcon> {}\nexport interface AppNavigationFooterProps extends ComponentProps<typeof Footer> {}\nexport interface AppNavigationMiniaturizeTriggerProps extends ComponentProps<typeof MiniaturizeTrigger> {}\n"],"mappings":"snBASM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,cAAe,CACtE,SAAU,EACZ,CAAC,EAGK,EAAoD,IAAA,EAAA,EAAA,QACjD,CAAG,EAEC,EAAO,EAAa,EAAU,KAAK,EAAG,OAAQ,CACzD,aAAc,CAEd,CACF,CAAC,EACY,EAAS,EAAY,EAAU,QAAQ,EAAG,QAAQ,EAClD,EAAO,EAAY,EAAU,MAAM,EAAG,MAAM,EAE5C,EAAO,EAAY,EAAU,KAAK,EAAG,MAAM,EAC3C,EAAe,EAAY,EAAU,KAAK,EAAG,cAAc,EAC3D,EAAc,EAAY,EAAU,KAAK,EAAG,aAAa,EACzD,EAAY,EAAY,EAAU,GAAG,EAAG,WAAW,EACnD,EAAW,EAAY,EAAA,KAAM,WAAY,CACpD,aAAc,CACZ,KAAM,IACR,CACF,CAAC,EACY,EAAY,EAAY,EAAA,IAAK,YAAa,CACrD,aAAc,CACZ,SAAU,SACZ,CACF,CAAC,EAEY,EAAS,EAAY,EAAU,QAAQ,EAAG,QAAQ,EAElD,EAAqB,EAAY,EAAU,KAAK,EAAG,qBAAsB,CACpF,aAAc,CACZ,QAAU,GAAkC,CAC1C,EAAE,eAAe,EAEjB,IAAM,EADe,aAAa,QAAQ,kBACzB,IAAiB,SAAW,OAAS,SACtD,aAAa,QAAQ,mBAAoB,CAAQ,EACjD,EAAE,cAAc,aAAa,aAAc,CAAQ,EACnD,OAAO,cAAc,IAAI,MAAM,SAAS,CAAC,CAC3C,EACA,UAAW,qCAET,aAAc,OAAO,aAAiB,KAAc,aAAa,QAAQ,kBAAkB,GAAc,OAE3G,UACE,EAAA,EAAA,KAAC,EAAA,KAAD,CAAA,UACE,EAAA,EAAA,KAAC,EAAA,QAAD,CAAsB,CAAA,CAClB,CAAA,CAEV,CACF,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
1
2
|
import { ComponentProps, FC, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
3
|
import { ComponentVariants } from '../../../utils/slots';
|
|
3
|
-
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
4
4
|
import { AppNavigationRecipe } from '@stokelp/styled-system/recipes';
|
|
5
5
|
import { TagProps } from '../..';
|
|
6
|
-
export declare const Root: ComponentVariants<StyledComponent<
|
|
7
|
-
export declare const Header: StyledComponent<
|
|
8
|
-
export declare const Body: StyledComponent<
|
|
9
|
-
export declare const Item: StyledComponent<
|
|
10
|
-
export declare const ItemSubItems: StyledComponent<
|
|
11
|
-
export declare const ItemContent: StyledComponent<
|
|
12
|
-
export declare const ItemLabel: StyledComponent<
|
|
6
|
+
export declare const Root: ComponentVariants<StyledComponent<"nav", {}>, AppNavigationRecipe>;
|
|
7
|
+
export declare const Header: StyledComponent<"header", {}>;
|
|
8
|
+
export declare const Body: StyledComponent<"main", {}>;
|
|
9
|
+
export declare const Item: StyledComponent<"div", {}>;
|
|
10
|
+
export declare const ItemSubItems: StyledComponent<"div", {}>;
|
|
11
|
+
export declare const ItemContent: StyledComponent<"div", {}>;
|
|
12
|
+
export declare const ItemLabel: StyledComponent<"p", {}>;
|
|
13
13
|
export declare const ItemIcon: FC<any>;
|
|
14
14
|
export declare const ItemAlpha: ForwardRefExoticComponent< TagProps & RefAttributes<HTMLDivElement>>;
|
|
15
|
-
export declare const Footer: StyledComponent<
|
|
16
|
-
export declare const MiniaturizeTrigger: StyledComponent<
|
|
15
|
+
export declare const Footer: StyledComponent<"footer", {}>;
|
|
16
|
+
export declare const MiniaturizeTrigger: StyledComponent<"div", {}>;
|
|
17
17
|
export interface AppNavigationProps extends ComponentProps<typeof Root> {
|
|
18
18
|
}
|
|
19
19
|
export interface AppNavigationHeaderProps extends ComponentProps<typeof Header> {
|
|
@@ -9,18 +9,18 @@ import { appNavigation as o } from "@stokelp/styled-system/recipes";
|
|
|
9
9
|
import { jsx as s } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/app/navigation/AppNavigation.tsx
|
|
11
11
|
var c = /* @__PURE__ */ e({
|
|
12
|
-
Body: () =>
|
|
13
|
-
Footer: () =>
|
|
14
|
-
Header: () =>
|
|
15
|
-
Item: () =>
|
|
16
|
-
ItemAlpha: () =>
|
|
17
|
-
ItemContent: () =>
|
|
18
|
-
ItemIcon: () =>
|
|
19
|
-
ItemLabel: () =>
|
|
20
|
-
ItemSubItems: () =>
|
|
21
|
-
MiniaturizeTrigger: () =>
|
|
22
|
-
Root: () =>
|
|
23
|
-
}), { withProvider: l, withContext: u } = t(o, { dataAttr: !0 }), d =
|
|
12
|
+
Body: () => m,
|
|
13
|
+
Footer: () => x,
|
|
14
|
+
Header: () => p,
|
|
15
|
+
Item: () => h,
|
|
16
|
+
ItemAlpha: () => b,
|
|
17
|
+
ItemContent: () => _,
|
|
18
|
+
ItemIcon: () => y,
|
|
19
|
+
ItemLabel: () => v,
|
|
20
|
+
ItemSubItems: () => g,
|
|
21
|
+
MiniaturizeTrigger: () => S,
|
|
22
|
+
Root: () => f
|
|
23
|
+
}), { withProvider: l, withContext: u } = t(o, { dataAttr: !0 }), d = (e) => a(e), f = l(d("nav"), "root", { defaultProps: {} }), p = u(d("header"), "header"), m = u(d("main"), "body"), h = u(d("div"), "item"), g = u(d("div"), "itemSubItems"), _ = u(d("div"), "itemContent"), v = u(d("p"), "itemLabel"), y = u(r, "itemIcon", { defaultProps: { size: "sm" } }), b = u(n, "itemAlpha", { defaultProps: { severity: "success" } }), x = u(d("footer"), "footer"), S = u(d("div"), "miniaturizeTrigger", { defaultProps: {
|
|
24
24
|
onClick: (e) => {
|
|
25
25
|
e.preventDefault();
|
|
26
26
|
let t = localStorage.getItem("isMiniaturizeNav") === "closed" ? "open" : "closed";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppNavigation.js","names":[],"sources":["../../../../src/components/app/navigation/AppNavigation.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { appNavigation } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Icon } from '~/components/icon/Icon'\nimport { ComponentProps, type MouseEvent } from 'react'\nimport { ArrowLeftCircleIcon } from '@heroicons/react/24/outline'\nimport { Tag } from '~/components'\n\nconst { withProvider, withContext } = createStyleContext(appNavigation, {\n dataAttr: true,\n})\n\nexport const Root = withProvider(
|
|
1
|
+
{"version":3,"file":"AppNavigation.js","names":[],"sources":["../../../../src/components/app/navigation/AppNavigation.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { appNavigation } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { createStyleContext } from '~/utils/slots'\nimport { Icon } from '~/components/icon/Icon'\nimport { ComponentProps, type JSX, type MouseEvent } from 'react'\nimport { ArrowLeftCircleIcon } from '@heroicons/react/24/outline'\nimport { Tag } from '~/components'\n\nconst { withProvider, withContext } = createStyleContext(appNavigation, {\n dataAttr: true,\n})\n\n// See Table.tsx for why we wrap `styled(tag)` to pin the literal tag.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nexport const Root = withProvider(styledTag('nav'), 'root', {\n defaultProps: {\n //'data-state': localStorage.getItem('isMiniaturizeNav') || 'open',\n },\n})\nexport const Header = withContext(styledTag('header'), 'header')\nexport const Body = withContext(styledTag('main'), 'body')\n\nexport const Item = withContext(styledTag('div'), 'item')\nexport const ItemSubItems = withContext(styledTag('div'), 'itemSubItems')\nexport const ItemContent = withContext(styledTag('div'), 'itemContent')\nexport const ItemLabel = withContext(styledTag('p'), 'itemLabel')\nexport const ItemIcon = withContext(Icon, 'itemIcon', {\n defaultProps: {\n size: 'sm',\n },\n})\nexport const ItemAlpha = withContext(Tag, 'itemAlpha', {\n defaultProps: {\n severity: 'success',\n },\n})\n\nexport const Footer = withContext(styledTag('footer'), 'footer')\n\nexport const MiniaturizeTrigger = withContext(styledTag('div'), 'miniaturizeTrigger', {\n defaultProps: {\n onClick: (e: MouseEvent<HTMLDivElement>) => {\n e.preventDefault()\n const currentState = localStorage.getItem('isMiniaturizeNav')\n const newState = currentState === 'closed' ? 'open' : 'closed'\n localStorage.setItem('isMiniaturizeNav', newState)\n e.currentTarget.setAttribute('data-state', newState)\n window.dispatchEvent(new Event('storage'))\n },\n className: 'app-navigation__miniaturizeTrigger',\n ...{\n 'data-state': typeof localStorage !== 'undefined' ? localStorage.getItem('isMiniaturizeNav') || 'open' : 'open',\n },\n children: (\n <Icon>\n <ArrowLeftCircleIcon />\n </Icon>\n ),\n },\n})\n\nexport interface AppNavigationProps extends ComponentProps<typeof Root> {}\nexport interface AppNavigationHeaderProps extends ComponentProps<typeof Header> {}\nexport interface AppNavigationBodyProps extends ComponentProps<typeof Body> {}\nexport interface AppNavigationItemProps extends ComponentProps<typeof Item> {}\nexport interface AppNavigationItemSubItemsProps extends ComponentProps<typeof ItemSubItems> {}\nexport interface AppNavigationItemContentProps extends ComponentProps<typeof ItemContent> {}\nexport type AppNavigationItemLabelProps = ComponentProps<typeof ItemLabel>\nexport interface AppNavigationItemIconProps extends ComponentProps<typeof ItemIcon> {}\nexport interface AppNavigationFooterProps extends ComponentProps<typeof Footer> {}\nexport interface AppNavigationMiniaturizeTriggerProps extends ComponentProps<typeof MiniaturizeTrigger> {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IASM,EAAE,iBAAc,mBAAgB,EAAmB,GAAe,EACtE,UAAU,GACZ,CAAC,GAGK,KAAoD,MACxD,EAAO,CAAG,GAEC,IAAO,EAAa,EAAU,KAAK,GAAG,QAAQ,EACzD,cAAc,CAEd,EACF,CAAC,GACY,IAAS,EAAY,EAAU,QAAQ,GAAG,QAAQ,GAClD,IAAO,EAAY,EAAU,MAAM,GAAG,MAAM,GAE5C,IAAO,EAAY,EAAU,KAAK,GAAG,MAAM,GAC3C,IAAe,EAAY,EAAU,KAAK,GAAG,cAAc,GAC3D,IAAc,EAAY,EAAU,KAAK,GAAG,aAAa,GACzD,IAAY,EAAY,EAAU,GAAG,GAAG,WAAW,GACnD,IAAW,EAAY,GAAM,YAAY,EACpD,cAAc,EACZ,MAAM,KACR,EACF,CAAC,GACY,IAAY,EAAY,GAAK,aAAa,EACrD,cAAc,EACZ,UAAU,UACZ,EACF,CAAC,GAEY,IAAS,EAAY,EAAU,QAAQ,GAAG,QAAQ,GAElD,IAAqB,EAAY,EAAU,KAAK,GAAG,sBAAsB,EACpF,cAAc;CACZ,UAAU,MAAkC;EAC1C,EAAE,eAAe;EAEjB,IAAM,IADe,aAAa,QAAQ,kBACzB,MAAiB,WAAW,SAAS;EAGtD,AAFA,aAAa,QAAQ,oBAAoB,CAAQ,GACjD,EAAE,cAAc,aAAa,cAAc,CAAQ,GACnD,OAAO,cAAc,IAAI,MAAM,SAAS,CAAC;CAC3C;CACA,WAAW;CAET,cAAc,OAAO,eAAiB,OAAc,aAAa,QAAQ,kBAAkB,KAAc;CAE3G,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,CAAsB,CAAA,EAClB,CAAA;AAEV,EACF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utils/slots.cjs");let n=require("@ark-ui/react"),r=require("@stokelp/styled-system/jsx"),i=require("@stokelp/styled-system/recipes"),a=require("react"),o=require("react/jsx-runtime"),s=require("react-is");s=e.__toESM(s,1);var{withProvider:c,withContext:l}=t.createStyleContext(i.breadcrumb),u=
|
|
1
|
+
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utils/slots.cjs");let n=require("@ark-ui/react"),r=require("@stokelp/styled-system/jsx"),i=require("@stokelp/styled-system/recipes"),a=require("react"),o=require("react/jsx-runtime"),s=require("react-is");s=e.__toESM(s,1);var{withProvider:c,withContext:l}=t.createStyleContext(i.breadcrumb),u=e=>(0,r.styled)(e),d=c(u(`nav`),`root`),f=l(u(`ol`),`list`),p=l(u(`li`),`item`),m=l((0,r.styled)(n.ark.a),`link`),h=(0,o.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,o.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M16.2803 11.4741C16.5732 11.767 16.5732 12.2418 16.2803 12.5347L8.78033 20.0347C8.48744 20.3276 8.01256 20.3276 7.71967 20.0347C7.42678 19.7418 7.42678 19.267 7.71967 18.9741L14.6893 12.0044L7.71967 5.03472C7.42678 4.74183 7.42678 4.26696 7.71967 3.97406C8.01256 3.68117 8.48744 3.68117 8.78033 3.97406L16.2803 11.4741Z`,fill:`#1E3A76`})}),g=(0,a.forwardRef)(({children:e,separator:t=h,...n},r)=>{let i=a.Children.toArray(s.isFragment(e)?void 0:e);return(0,o.jsx)(d,{...n,"aria-label":n[`aria-label`]??`breadcrumb`,ref:r,children:(0,o.jsx)(f,{children:i.map((e,n)=>(0,a.cloneElement)(e,{"aria-current":n===i.length-1?`page`:void 0,children:n===i.length-1?e.props.children:(0,o.jsxs)(o.Fragment,{children:[e.props.children,t?(0,o.jsx)(o.Fragment,{children:typeof t==`object`?(0,a.cloneElement)(t):(0,o.jsx)(`span`,{role:`presentation`,children:t})}):null]})}))})})});exports.Breadcrumb=g,exports.BreadcrumbItem=p,exports.BreadcrumbLink=m;
|
|
2
2
|
//# sourceMappingURL=Breadcrumb.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.cjs","names":[],"sources":["../../../src/components/breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { breadcrumb } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { ark } from '@ark-ui/react'\nimport * as ReactIs from 'react-is'\nimport { Children, cloneElement, ComponentProps, type FC, forwardRef, ReactElement, ReactNode } from 'react'\n\nconst { withProvider, withContext } = createStyleContext(breadcrumb)\n\nconst StyledBreadcrumb = withProvider(
|
|
1
|
+
{"version":3,"file":"Breadcrumb.cjs","names":[],"sources":["../../../src/components/breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { breadcrumb } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { createStyleContext } from '~/utils/slots'\nimport { ark } from '@ark-ui/react'\nimport * as ReactIs from 'react-is'\nimport { Children, cloneElement, ComponentProps, type FC, forwardRef, type JSX, ReactElement, ReactNode } from 'react'\n\nconst { withProvider, withContext } = createStyleContext(breadcrumb)\n\n// See Table.tsx for why we pin the literal tag.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nconst StyledBreadcrumb = withProvider(styledTag('nav'), 'root')\nconst StyledBreadcrumbList = withContext(styledTag('ol'), 'list')\n\nexport const BreadcrumbItem = withContext(styledTag('li'), 'item')\nexport const BreadcrumbLink = withContext(styled(ark.a), 'link')\n\nconst DefaultSeparator = (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.2803 11.4741C16.5732 11.767 16.5732 12.2418 16.2803 12.5347L8.78033 20.0347C8.48744 20.3276 8.01256 20.3276 7.71967 20.0347C7.42678 19.7418 7.42678 19.267 7.71967 18.9741L14.6893 12.0044L7.71967 5.03472C7.42678 4.74183 7.42678 4.26696 7.71967 3.97406C8.01256 3.68117 8.48744 3.68117 8.78033 3.97406L16.2803 11.4741Z\"\n fill=\"#1E3A76\"\n />\n </svg>\n)\n\nexport const Breadcrumb = forwardRef<HTMLElement, BreadcrumbProps>(\n ({ children, separator = DefaultSeparator, ...props }, ref) => {\n const child = Children.toArray(\n ReactIs.isFragment(children) ? undefined : children,\n ) as ReactElement<BreadcrumbItemProps>[]\n\n return (\n <StyledBreadcrumb {...props} aria-label={props['aria-label'] ?? 'breadcrumb'} ref={ref}>\n <StyledBreadcrumbList>\n {child.map((item, index) => {\n return cloneElement<BreadcrumbItemProps>(item, {\n 'aria-current': index === child.length - 1 ? 'page' : undefined,\n children:\n index === child.length - 1 ? (\n item.props.children\n ) : (\n <>\n {item.props.children}\n {separator ? (\n <>\n {typeof separator === 'object' ? (\n cloneElement(separator as ReactElement)\n ) : (\n <span role=\"presentation\">{separator}</span>\n )}\n </>\n ) : null}\n </>\n ),\n })\n })}\n </StyledBreadcrumbList>\n </StyledBreadcrumb>\n )\n },\n) as FC<BreadcrumbProps>\n\nexport type BreadcrumbLinkProps = ComponentProps<typeof BreadcrumbLink>\nexport type BreadcrumbItemProps = ComponentProps<typeof BreadcrumbItem>\nexport type BreadcrumbProps = ComponentProps<typeof StyledBreadcrumb> & {\n separator?: ReactNode\n}\n"],"mappings":"oTAQA,GAAM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,UAAU,EAG7D,EAAoD,IAAA,EAAA,EAAA,QACjD,CAAG,EAEN,EAAmB,EAAa,EAAU,KAAK,EAAG,MAAM,EACxD,EAAuB,EAAY,EAAU,IAAI,EAAG,MAAM,EAEnD,EAAiB,EAAY,EAAU,IAAI,EAAG,MAAM,EACpD,EAAiB,GAAA,EAAA,EAAA,QAAmB,EAAA,IAAI,CAAC,EAAG,MAAM,EAEzD,GACJ,EAAA,EAAA,KAAC,MAAD,CAAK,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,uCAChE,EAAA,EAAA,KAAC,OAAD,CACE,SAAS,UACT,SAAS,UACT,EAAE,kUACF,KAAK,SACN,CAAA,CACE,CAAA,EAGM,GAAA,EAAA,EAAA,aACV,CAAE,WAAU,YAAY,EAAkB,GAAG,GAAS,IAAQ,CAC7D,IAAM,EAAQ,EAAA,SAAS,QACrB,EAAQ,WAAW,CAAQ,EAAI,IAAA,GAAY,CAC7C,EAEA,OACE,EAAA,EAAA,KAAC,EAAD,CAAkB,GAAI,EAAO,aAAY,EAAM,eAAiB,aAAmB,gBACjF,EAAA,EAAA,KAAC,EAAD,CAAA,SACG,EAAM,KAAK,EAAM,KAChB,EAAA,EAAA,cAAyC,EAAM,CAC7C,eAAgB,IAAU,EAAM,OAAS,EAAI,OAAS,IAAA,GACtD,SACE,IAAU,EAAM,OAAS,EACvB,EAAK,MAAM,UAEX,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,EAAK,MAAM,SACX,GACC,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,OAAO,GAAc,UAAA,EAAA,EAAA,cACP,CAAyB,GAEtC,EAAA,EAAA,KAAC,OAAD,CAAM,KAAK,wBAAgB,CAAgB,CAAA,CAE7C,CAAA,EACA,IACJ,CAAA,CAAA,CAER,CAAC,CACF,CACmB,CAAA,CACN,CAAA,CAEtB,CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
1
2
|
import { ComponentProps, FC, ReactNode, ForwardRefExoticComponent, ClassAttributes, AnchorHTMLAttributes } from 'react';
|
|
2
3
|
import { ComponentVariants } from '../../utils/slots';
|
|
3
|
-
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
4
4
|
import { BreadcrumbRecipe } from '@stokelp/styled-system/recipes';
|
|
5
5
|
import { PolymorphicProps } from '@ark-ui/react';
|
|
6
|
-
declare const StyledBreadcrumb: ComponentVariants<StyledComponent<
|
|
7
|
-
export declare const BreadcrumbItem: StyledComponent<
|
|
8
|
-
export declare const BreadcrumbLink: StyledComponent<ForwardRefExoticComponent< ClassAttributes<HTMLAnchorElement> & AnchorHTMLAttributes<HTMLAnchorElement> & PolymorphicProps>, {}>;
|
|
6
|
+
declare const StyledBreadcrumb: ComponentVariants<StyledComponent<"nav", {}>, BreadcrumbRecipe>;
|
|
7
|
+
export declare const BreadcrumbItem: StyledComponent<"li", {}>;
|
|
8
|
+
export declare const BreadcrumbLink: StyledComponent< ForwardRefExoticComponent< ClassAttributes<HTMLAnchorElement> & AnchorHTMLAttributes<HTMLAnchorElement> & PolymorphicProps>, {}>;
|
|
9
9
|
export declare const Breadcrumb: FC<BreadcrumbProps>;
|
|
10
10
|
export type BreadcrumbLinkProps = ComponentProps<typeof BreadcrumbLink>;
|
|
11
11
|
export type BreadcrumbItemProps = ComponentProps<typeof BreadcrumbItem>;
|
|
@@ -7,7 +7,7 @@ import { Children as i, cloneElement as a, forwardRef as o } from "react";
|
|
|
7
7
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
8
|
import * as u from "react-is";
|
|
9
9
|
//#region src/components/breadcrumb/Breadcrumb.tsx
|
|
10
|
-
var { withProvider: d, withContext: f } = e(r), p =
|
|
10
|
+
var { withProvider: d, withContext: f } = e(r), p = (e) => n(e), m = d(p("nav"), "root"), h = f(p("ol"), "list"), g = f(p("li"), "item"), _ = f(n(t.a), "link"), v = /* @__PURE__ */ c("svg", {
|
|
11
11
|
width: "16",
|
|
12
12
|
height: "16",
|
|
13
13
|
viewBox: "0 0 24 24",
|
|
@@ -19,13 +19,13 @@ var { withProvider: d, withContext: f } = e(r), p = d(n("nav"), "root"), m = f(n
|
|
|
19
19
|
d: "M16.2803 11.4741C16.5732 11.767 16.5732 12.2418 16.2803 12.5347L8.78033 20.0347C8.48744 20.3276 8.01256 20.3276 7.71967 20.0347C7.42678 19.7418 7.42678 19.267 7.71967 18.9741L14.6893 12.0044L7.71967 5.03472C7.42678 4.74183 7.42678 4.26696 7.71967 3.97406C8.01256 3.68117 8.48744 3.68117 8.78033 3.97406L16.2803 11.4741Z",
|
|
20
20
|
fill: "#1E3A76"
|
|
21
21
|
})
|
|
22
|
-
}),
|
|
22
|
+
}), y = o(({ children: e, separator: t = v, ...n }, r) => {
|
|
23
23
|
let o = i.toArray(u.isFragment(e) ? void 0 : e);
|
|
24
|
-
return /* @__PURE__ */ c(
|
|
24
|
+
return /* @__PURE__ */ c(m, {
|
|
25
25
|
...n,
|
|
26
26
|
"aria-label": n["aria-label"] ?? "breadcrumb",
|
|
27
27
|
ref: r,
|
|
28
|
-
children: /* @__PURE__ */ c(
|
|
28
|
+
children: /* @__PURE__ */ c(h, { children: o.map((e, n) => a(e, {
|
|
29
29
|
"aria-current": n === o.length - 1 ? "page" : void 0,
|
|
30
30
|
children: n === o.length - 1 ? e.props.children : /* @__PURE__ */ l(s, { children: [e.props.children, t ? /* @__PURE__ */ c(s, { children: typeof t == "object" ? a(t) : /* @__PURE__ */ c("span", {
|
|
31
31
|
role: "presentation",
|
|
@@ -35,6 +35,6 @@ var { withProvider: d, withContext: f } = e(r), p = d(n("nav"), "root"), m = f(n
|
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
//#endregion
|
|
38
|
-
export {
|
|
38
|
+
export { y as Breadcrumb, g as BreadcrumbItem, _ as BreadcrumbLink };
|
|
39
39
|
|
|
40
40
|
//# sourceMappingURL=Breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.js","names":[],"sources":["../../../src/components/breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { breadcrumb } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { ark } from '@ark-ui/react'\nimport * as ReactIs from 'react-is'\nimport { Children, cloneElement, ComponentProps, type FC, forwardRef, ReactElement, ReactNode } from 'react'\n\nconst { withProvider, withContext } = createStyleContext(breadcrumb)\n\nconst StyledBreadcrumb = withProvider(
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","names":[],"sources":["../../../src/components/breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { breadcrumb } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { createStyleContext } from '~/utils/slots'\nimport { ark } from '@ark-ui/react'\nimport * as ReactIs from 'react-is'\nimport { Children, cloneElement, ComponentProps, type FC, forwardRef, type JSX, ReactElement, ReactNode } from 'react'\n\nconst { withProvider, withContext } = createStyleContext(breadcrumb)\n\n// See Table.tsx for why we pin the literal tag.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nconst StyledBreadcrumb = withProvider(styledTag('nav'), 'root')\nconst StyledBreadcrumbList = withContext(styledTag('ol'), 'list')\n\nexport const BreadcrumbItem = withContext(styledTag('li'), 'item')\nexport const BreadcrumbLink = withContext(styled(ark.a), 'link')\n\nconst DefaultSeparator = (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.2803 11.4741C16.5732 11.767 16.5732 12.2418 16.2803 12.5347L8.78033 20.0347C8.48744 20.3276 8.01256 20.3276 7.71967 20.0347C7.42678 19.7418 7.42678 19.267 7.71967 18.9741L14.6893 12.0044L7.71967 5.03472C7.42678 4.74183 7.42678 4.26696 7.71967 3.97406C8.01256 3.68117 8.48744 3.68117 8.78033 3.97406L16.2803 11.4741Z\"\n fill=\"#1E3A76\"\n />\n </svg>\n)\n\nexport const Breadcrumb = forwardRef<HTMLElement, BreadcrumbProps>(\n ({ children, separator = DefaultSeparator, ...props }, ref) => {\n const child = Children.toArray(\n ReactIs.isFragment(children) ? undefined : children,\n ) as ReactElement<BreadcrumbItemProps>[]\n\n return (\n <StyledBreadcrumb {...props} aria-label={props['aria-label'] ?? 'breadcrumb'} ref={ref}>\n <StyledBreadcrumbList>\n {child.map((item, index) => {\n return cloneElement<BreadcrumbItemProps>(item, {\n 'aria-current': index === child.length - 1 ? 'page' : undefined,\n children:\n index === child.length - 1 ? (\n item.props.children\n ) : (\n <>\n {item.props.children}\n {separator ? (\n <>\n {typeof separator === 'object' ? (\n cloneElement(separator as ReactElement)\n ) : (\n <span role=\"presentation\">{separator}</span>\n )}\n </>\n ) : null}\n </>\n ),\n })\n })}\n </StyledBreadcrumbList>\n </StyledBreadcrumb>\n )\n },\n) as FC<BreadcrumbProps>\n\nexport type BreadcrumbLinkProps = ComponentProps<typeof BreadcrumbLink>\nexport type BreadcrumbItemProps = ComponentProps<typeof BreadcrumbItem>\nexport type BreadcrumbProps = ComponentProps<typeof StyledBreadcrumb> & {\n separator?: ReactNode\n}\n"],"mappings":";;;;;;;;;AAQA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,CAAU,GAG7D,KAAoD,MACxD,EAAO,CAAG,GAEN,IAAmB,EAAa,EAAU,KAAK,GAAG,MAAM,GACxD,IAAuB,EAAY,EAAU,IAAI,GAAG,MAAM,GAEnD,IAAiB,EAAY,EAAU,IAAI,GAAG,MAAM,GACpD,IAAiB,EAAY,EAAO,EAAI,CAAC,GAAG,MAAM,GAEzD,IACJ,kBAAC,OAAD;CAAK,OAAM;CAAK,QAAO;CAAK,SAAQ;CAAY,MAAK;CAAO,OAAM;WAChE,kBAAC,QAAD;EACE,UAAS;EACT,UAAS;EACT,GAAE;EACF,MAAK;CACN,CAAA;AACE,CAAA,GAGM,IAAa,GACvB,EAAE,aAAU,eAAY,GAAkB,GAAG,KAAS,MAAQ;CAC7D,IAAM,IAAQ,EAAS,QACrB,EAAQ,WAAW,CAAQ,IAAI,KAAA,IAAY,CAC7C;CAEA,OACE,kBAAC,GAAD;EAAkB,GAAI;EAAO,cAAY,EAAM,iBAAiB;EAAmB;YACjF,kBAAC,GAAD,EAAA,UACG,EAAM,KAAK,GAAM,MACT,EAAkC,GAAM;GAC7C,gBAAgB,MAAU,EAAM,SAAS,IAAI,SAAS,KAAA;GACtD,UACE,MAAU,EAAM,SAAS,IACvB,EAAK,MAAM,WAEX,kBAAA,GAAA,EAAA,UAAA,CACG,EAAK,MAAM,UACX,IACC,kBAAA,GAAA,EAAA,UACG,OAAO,KAAc,WACpB,EAAa,CAAyB,IAEtC,kBAAC,QAAD;IAAM,MAAK;cAAgB;GAAgB,CAAA,EAE7C,CAAA,IACA,IACJ,EAAA,CAAA;EAER,CAAC,CACF,EACmB,CAAA;CACN,CAAA;AAEtB,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs","names":[],"sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import { ark } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { button } from '@stokelp/styled-system/recipes'\nimport type { ComponentProps } from 'react'\n\nexport const Button = styled(ark.button, button)\nexport
|
|
1
|
+
{"version":3,"file":"Button.cjs","names":[],"sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import { ark, type HTMLArkProps } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { button, type ButtonVariantProps } from '@stokelp/styled-system/recipes'\nimport type { JsxStyleProps } from '@stokelp/styled-system/types'\nimport type { ComponentProps, JSX } from 'react'\n\n// We need three things from the Button typing:\n// 1. Native `<button>` HTML attrs (including a properly-typed onClick event)\n// 2. ark's polymorphic `asChild` prop\n// 3. The button recipe's variant props\n//\n// `styled(ark.button, button)` runtime is correct, but TS d.ts emit widens\n// the inferred component type and consumers lose onClick typing (TS7006).\n// This explicit cast pins all three layers.\ntype ButtonComponentProps = HTMLArkProps<'button'> & JsxStyleProps & ButtonVariantProps\ntype ButtonComponent = ((props: ButtonComponentProps) => JSX.Element) & { displayName?: string }\n\nexport const Button = styled(ark.button, button) as unknown as ButtonComponent\nexport type ButtonProps = ComponentProps<typeof Button>\n"],"mappings":"gIAiBA,IAAa,GAAA,EAAA,EAAA,QAAgB,EAAA,IAAI,OAAQ,EAAA,MAAM"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
}
|
|
1
|
+
import { HTMLArkProps } from '@ark-ui/react';
|
|
2
|
+
import { ButtonVariantProps } from '@stokelp/styled-system/recipes';
|
|
3
|
+
import { JsxStyleProps } from '@stokelp/styled-system/types';
|
|
4
|
+
import { ComponentProps, JSX } from 'react';
|
|
5
|
+
type ButtonComponentProps = HTMLArkProps<'button'> & JsxStyleProps & ButtonVariantProps;
|
|
6
|
+
type ButtonComponent = ((props: ButtonComponentProps) => JSX.Element) & {
|
|
7
|
+
displayName?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const Button: ButtonComponent;
|
|
10
|
+
export type ButtonProps = ComponentProps<typeof Button>;
|
|
11
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","names":[],"sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import { ark } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { button } from '@stokelp/styled-system/recipes'\nimport type { ComponentProps } from 'react'\n\nexport const Button = styled(ark.button, button)\nexport
|
|
1
|
+
{"version":3,"file":"Button.js","names":[],"sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import { ark, type HTMLArkProps } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { button, type ButtonVariantProps } from '@stokelp/styled-system/recipes'\nimport type { JsxStyleProps } from '@stokelp/styled-system/types'\nimport type { ComponentProps, JSX } from 'react'\n\n// We need three things from the Button typing:\n// 1. Native `<button>` HTML attrs (including a properly-typed onClick event)\n// 2. ark's polymorphic `asChild` prop\n// 3. The button recipe's variant props\n//\n// `styled(ark.button, button)` runtime is correct, but TS d.ts emit widens\n// the inferred component type and consumers lose onClick typing (TS7006).\n// This explicit cast pins all three layers.\ntype ButtonComponentProps = HTMLArkProps<'button'> & JsxStyleProps & ButtonVariantProps\ntype ButtonComponent = ((props: ButtonComponentProps) => JSX.Element) & { displayName?: string }\n\nexport const Button = styled(ark.button, button) as unknown as ButtonComponent\nexport type ButtonProps = ComponentProps<typeof Button>\n"],"mappings":";;;;;AAiBA,IAAa,IAAS,EAAO,EAAI,QAAQ,CAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../utils/slots.cjs"),t=require("../../shared/assets/icons.cjs");let n=require("@ark-ui/react"),r=require("@stokelp/styled-system/jsx"),i=require("@stokelp/styled-system/recipes"),a=require("react"),o=require("react/jsx-runtime"),s=require("@stokelp/styled-system/css");var{withProvider:c,withContext:l}=e.createStyleContext(i.checkboxCard,{dataAttr:!0}),u=c((0,r.styled)(n.Checkbox.Root)),
|
|
1
|
+
"use client";const e=require("../../utils/slots.cjs"),t=require("../../shared/assets/icons.cjs");let n=require("@ark-ui/react"),r=require("@stokelp/styled-system/jsx"),i=require("@stokelp/styled-system/recipes"),a=require("react"),o=require("react/jsx-runtime"),s=require("@stokelp/styled-system/css");var{withProvider:c,withContext:l}=e.createStyleContext(i.checkboxCard,{dataAttr:!0}),u=e=>(0,r.styled)(e),d=c((0,r.styled)(n.Checkbox.Root)),f=l((0,r.styled)(n.Checkbox.Label),`title`),p=l(u(`div`),`content`),m=l(u(`p`),`description`),h=l((0,r.styled)(n.ark.img),`image`),g=(0,a.forwardRef)((e,a)=>{let[c,l]=i.checkboxCard.splitVariantProps(e),[u,f]=(0,r.splitCssProps)(l),{children:p,className:m,...h}=f,g=(0,i.checkboxCard)(c);return(0,o.jsxs)(d,{ref:a,className:(0,s.cx)(g.root,(0,s.css)(u),m),...h,value:h.value,children:[(0,o.jsxs)(n.Checkbox.Control,{className:g.control,children:[(0,o.jsx)(n.Checkbox.Indicator,{children:(0,o.jsx)(t.CheckIcon,{})}),(0,o.jsx)(n.Checkbox.Indicator,{indeterminate:!0,children:(0,o.jsx)(t.MinusIcon,{})})]}),p,(0,o.jsx)(n.Checkbox.HiddenInput,{})]})});g.displayName=`CheckboxCard`,exports.CheckboxCard=g,exports.CheckboxCardContent=p,exports.CheckboxCardDescription=m,exports.CheckboxCardImage=h,exports.CheckboxCardTitle=f;
|
|
2
2
|
//# sourceMappingURL=CheckboxCard.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxCard.cjs","names":[],"sources":["../../../src/components/checkbox-card/CheckboxCard.tsx"],"sourcesContent":["import { ark, Checkbox as ArkCheckbox, type CheckboxRootProps } from '@ark-ui/react'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { splitCssProps, styled } from '@stokelp/styled-system/jsx'\nimport { checkboxCard, type CheckboxCardVariantProps } from '@stokelp/styled-system/recipes'\nimport type { Assign, JsxStyleProps } from '@stokelp/styled-system/types'\nimport { ComponentProps, forwardRef } from 'react'\nimport { createStyleContext } from '~/utils/slots'\nimport { type CheckboxProps } from '~/components/checkbox'\nimport { CheckIcon, MinusIcon } from '~/shared/assets/icons'\n\ntype StyledCheckboxRootProps = Assign<JsxStyleProps, CheckboxRootProps>\n\nexport interface CheckboxCardProps extends Omit<StyledCheckboxRootProps, 'value'>, CheckboxCardVariantProps {\n value?: string | number\n}\n\nconst { withProvider, withContext } = createStyleContext(checkboxCard, {\n dataAttr: true,\n})\n\nconst CheckboxCardRoot = withProvider(styled(ArkCheckbox.Root))\n\nexport const CheckboxCardTitle = withContext(styled(ArkCheckbox.Label), 'title')\nexport const CheckboxCardContent = withContext(
|
|
1
|
+
{"version":3,"file":"CheckboxCard.cjs","names":[],"sources":["../../../src/components/checkbox-card/CheckboxCard.tsx"],"sourcesContent":["import { ark, Checkbox as ArkCheckbox, type CheckboxRootProps } from '@ark-ui/react'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { splitCssProps, styled } from '@stokelp/styled-system/jsx'\nimport { checkboxCard, type CheckboxCardVariantProps } from '@stokelp/styled-system/recipes'\nimport type { Assign, JsxStyleProps, StyledComponent } from '@stokelp/styled-system/types'\nimport { ComponentProps, forwardRef, type JSX } from 'react'\nimport { createStyleContext } from '~/utils/slots'\nimport { type CheckboxProps } from '~/components/checkbox'\nimport { CheckIcon, MinusIcon } from '~/shared/assets/icons'\n\ntype StyledCheckboxRootProps = Assign<JsxStyleProps, CheckboxRootProps>\n\nexport interface CheckboxCardProps extends Omit<StyledCheckboxRootProps, 'value'>, CheckboxCardVariantProps {\n value?: string | number\n}\n\nconst { withProvider, withContext } = createStyleContext(checkboxCard, {\n dataAttr: true,\n})\n\n// See Table.tsx for why we pin the literal tag.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nconst CheckboxCardRoot = withProvider(styled(ArkCheckbox.Root))\n\nexport const CheckboxCardTitle = withContext(styled(ArkCheckbox.Label), 'title')\nexport const CheckboxCardContent = withContext(styledTag('div'), 'content')\nexport const CheckboxCardDescription = withContext(styledTag('p'), 'description')\nexport const CheckboxCardImage = withContext(styled(ark.img), 'image')\n\nexport type CheckboxCardTitleProps = ComponentProps<typeof CheckboxCardTitle>\nexport type CheckboxCardContentProps = ComponentProps<typeof CheckboxCardContent>\nexport type CheckboxCardDescriptionProps = ComponentProps<typeof CheckboxCardDescription>\nexport type CheckboxCardImageProps = ComponentProps<typeof CheckboxCardImage>\n\nexport const CheckboxCard = forwardRef<HTMLLabelElement, CheckboxProps>((props, ref) => {\n const [variantProps, checkboxProps] = checkboxCard.splitVariantProps(props)\n const [cssProps, localProps] = splitCssProps(checkboxProps)\n const { children, className, ...rootProps } = localProps\n const styles = checkboxCard(variantProps)\n\n return (\n <CheckboxCardRoot\n ref={ref}\n className={cx(styles.root, css(cssProps), className)}\n {...rootProps}\n value={rootProps.value as string | undefined}\n >\n <ArkCheckbox.Control className={styles.control}>\n <ArkCheckbox.Indicator>\n <CheckIcon />\n </ArkCheckbox.Indicator>\n <ArkCheckbox.Indicator indeterminate>\n <MinusIcon />\n </ArkCheckbox.Indicator>\n </ArkCheckbox.Control>\n {children}\n <ArkCheckbox.HiddenInput />\n </CheckboxCardRoot>\n )\n})\n\nCheckboxCard.displayName = 'CheckboxCard'\n"],"mappings":"8SAgBA,GAAM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,aAAc,CACrE,SAAU,EACZ,CAAC,EAGK,EAAoD,IAAA,EAAA,EAAA,QACjD,CAAG,EAEN,EAAmB,GAAA,EAAA,EAAA,QAAoB,EAAA,SAAY,IAAI,CAAC,EAEjD,EAAoB,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,KAAK,EAAG,OAAO,EAClE,EAAsB,EAAY,EAAU,KAAK,EAAG,SAAS,EAC7D,EAA0B,EAAY,EAAU,GAAG,EAAG,aAAa,EACnE,EAAoB,GAAA,EAAA,EAAA,QAAmB,EAAA,IAAI,GAAG,EAAG,OAAO,EAOxD,GAAA,EAAA,EAAA,aAA4D,EAAO,IAAQ,CACtF,GAAM,CAAC,EAAc,GAAiB,EAAA,aAAa,kBAAkB,CAAK,EACpE,CAAC,EAAU,IAAA,EAAA,EAAA,eAA4B,CAAa,EACpD,CAAE,WAAU,YAAW,GAAG,GAAc,EACxC,GAAA,EAAA,EAAA,cAAsB,CAAY,EAExC,OACE,EAAA,EAAA,MAAC,EAAD,CACO,MACL,WAAA,EAAA,EAAA,IAAc,EAAO,MAAA,EAAA,EAAA,KAAU,CAAQ,EAAG,CAAS,EACnD,GAAI,EACJ,MAAO,EAAU,eAJnB,EAME,EAAA,EAAA,MAAC,EAAA,SAAY,QAAb,CAAqB,UAAW,EAAO,iBAAvC,EACE,EAAA,EAAA,KAAC,EAAA,SAAY,UAAb,CAAA,UACE,EAAA,EAAA,KAAC,EAAA,UAAD,CAAY,CAAA,CACS,CAAA,GACvB,EAAA,EAAA,KAAC,EAAA,SAAY,UAAb,CAAuB,cAAA,aACrB,EAAA,EAAA,KAAC,EAAA,UAAD,CAAY,CAAA,CACS,CAAA,CACJ,IACpB,GACD,EAAA,EAAA,KAAC,EAAA,SAAY,YAAb,CAA0B,CAAA,CACV,GAEtB,CAAC,EAED,EAAa,YAAc"}
|
|
@@ -7,10 +7,10 @@ type StyledCheckboxRootProps = Assign<JsxStyleProps, CheckboxRootProps>;
|
|
|
7
7
|
export interface CheckboxCardProps extends Omit<StyledCheckboxRootProps, 'value'>, CheckboxCardVariantProps {
|
|
8
8
|
value?: string | number;
|
|
9
9
|
}
|
|
10
|
-
export declare const CheckboxCardTitle: StyledComponent<ForwardRefExoticComponent<ArkCheckbox.LabelProps & RefAttributes<HTMLSpanElement>>, {}>;
|
|
11
|
-
export declare const CheckboxCardContent: StyledComponent<
|
|
12
|
-
export declare const CheckboxCardDescription: StyledComponent<
|
|
13
|
-
export declare const CheckboxCardImage: StyledComponent<ForwardRefExoticComponent< ClassAttributes<HTMLImageElement> & ImgHTMLAttributes<HTMLImageElement> & PolymorphicProps>, {}>;
|
|
10
|
+
export declare const CheckboxCardTitle: StyledComponent< ForwardRefExoticComponent<ArkCheckbox.LabelProps & RefAttributes<HTMLSpanElement>>, {}>;
|
|
11
|
+
export declare const CheckboxCardContent: StyledComponent<"div", {}>;
|
|
12
|
+
export declare const CheckboxCardDescription: StyledComponent<"p", {}>;
|
|
13
|
+
export declare const CheckboxCardImage: StyledComponent< ForwardRefExoticComponent< ClassAttributes<HTMLImageElement> & ImgHTMLAttributes<HTMLImageElement> & PolymorphicProps>, {}>;
|
|
14
14
|
export type CheckboxCardTitleProps = ComponentProps<typeof CheckboxCardTitle>;
|
|
15
15
|
export type CheckboxCardContentProps = ComponentProps<typeof CheckboxCardContent>;
|
|
16
16
|
export type CheckboxCardDescriptionProps = ComponentProps<typeof CheckboxCardDescription>;
|
|
@@ -8,9 +8,9 @@ import { forwardRef as c } from "react";
|
|
|
8
8
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
9
|
import { css as d, cx as f } from "@stokelp/styled-system/css";
|
|
10
10
|
//#region src/components/checkbox-card/CheckboxCard.tsx
|
|
11
|
-
var { withProvider: p, withContext: m } = e(s, { dataAttr: !0 }), h = p(o(r.Root)),
|
|
12
|
-
let [o, c] = s.splitVariantProps(e), [p, m] = a(c), { children:
|
|
13
|
-
return /* @__PURE__ */ u(
|
|
11
|
+
var { withProvider: p, withContext: m } = e(s, { dataAttr: !0 }), h = (e) => o(e), g = p(o(r.Root)), _ = m(o(r.Label), "title"), v = m(h("div"), "content"), y = m(h("p"), "description"), b = m(o(i.img), "image"), x = c((e, i) => {
|
|
12
|
+
let [o, c] = s.splitVariantProps(e), [p, m] = a(c), { children: h, className: _, ...v } = m, y = s(o);
|
|
13
|
+
return /* @__PURE__ */ u(g, {
|
|
14
14
|
ref: i,
|
|
15
15
|
className: f(y.root, d(p), _),
|
|
16
16
|
...v,
|
|
@@ -23,13 +23,13 @@ var { withProvider: p, withContext: m } = e(s, { dataAttr: !0 }), h = p(o(r.Root
|
|
|
23
23
|
children: /* @__PURE__ */ l(n, {})
|
|
24
24
|
})]
|
|
25
25
|
}),
|
|
26
|
-
|
|
26
|
+
h,
|
|
27
27
|
/* @__PURE__ */ l(r.HiddenInput, {})
|
|
28
28
|
]
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
|
-
|
|
31
|
+
x.displayName = "CheckboxCard";
|
|
32
32
|
//#endregion
|
|
33
|
-
export {
|
|
33
|
+
export { x as CheckboxCard, v as CheckboxCardContent, y as CheckboxCardDescription, b as CheckboxCardImage, _ as CheckboxCardTitle };
|
|
34
34
|
|
|
35
35
|
//# sourceMappingURL=CheckboxCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxCard.js","names":[],"sources":["../../../src/components/checkbox-card/CheckboxCard.tsx"],"sourcesContent":["import { ark, Checkbox as ArkCheckbox, type CheckboxRootProps } from '@ark-ui/react'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { splitCssProps, styled } from '@stokelp/styled-system/jsx'\nimport { checkboxCard, type CheckboxCardVariantProps } from '@stokelp/styled-system/recipes'\nimport type { Assign, JsxStyleProps } from '@stokelp/styled-system/types'\nimport { ComponentProps, forwardRef } from 'react'\nimport { createStyleContext } from '~/utils/slots'\nimport { type CheckboxProps } from '~/components/checkbox'\nimport { CheckIcon, MinusIcon } from '~/shared/assets/icons'\n\ntype StyledCheckboxRootProps = Assign<JsxStyleProps, CheckboxRootProps>\n\nexport interface CheckboxCardProps extends Omit<StyledCheckboxRootProps, 'value'>, CheckboxCardVariantProps {\n value?: string | number\n}\n\nconst { withProvider, withContext } = createStyleContext(checkboxCard, {\n dataAttr: true,\n})\n\nconst CheckboxCardRoot = withProvider(styled(ArkCheckbox.Root))\n\nexport const CheckboxCardTitle = withContext(styled(ArkCheckbox.Label), 'title')\nexport const CheckboxCardContent = withContext(
|
|
1
|
+
{"version":3,"file":"CheckboxCard.js","names":[],"sources":["../../../src/components/checkbox-card/CheckboxCard.tsx"],"sourcesContent":["import { ark, Checkbox as ArkCheckbox, type CheckboxRootProps } from '@ark-ui/react'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { splitCssProps, styled } from '@stokelp/styled-system/jsx'\nimport { checkboxCard, type CheckboxCardVariantProps } from '@stokelp/styled-system/recipes'\nimport type { Assign, JsxStyleProps, StyledComponent } from '@stokelp/styled-system/types'\nimport { ComponentProps, forwardRef, type JSX } from 'react'\nimport { createStyleContext } from '~/utils/slots'\nimport { type CheckboxProps } from '~/components/checkbox'\nimport { CheckIcon, MinusIcon } from '~/shared/assets/icons'\n\ntype StyledCheckboxRootProps = Assign<JsxStyleProps, CheckboxRootProps>\n\nexport interface CheckboxCardProps extends Omit<StyledCheckboxRootProps, 'value'>, CheckboxCardVariantProps {\n value?: string | number\n}\n\nconst { withProvider, withContext } = createStyleContext(checkboxCard, {\n dataAttr: true,\n})\n\n// See Table.tsx for why we pin the literal tag.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nconst CheckboxCardRoot = withProvider(styled(ArkCheckbox.Root))\n\nexport const CheckboxCardTitle = withContext(styled(ArkCheckbox.Label), 'title')\nexport const CheckboxCardContent = withContext(styledTag('div'), 'content')\nexport const CheckboxCardDescription = withContext(styledTag('p'), 'description')\nexport const CheckboxCardImage = withContext(styled(ark.img), 'image')\n\nexport type CheckboxCardTitleProps = ComponentProps<typeof CheckboxCardTitle>\nexport type CheckboxCardContentProps = ComponentProps<typeof CheckboxCardContent>\nexport type CheckboxCardDescriptionProps = ComponentProps<typeof CheckboxCardDescription>\nexport type CheckboxCardImageProps = ComponentProps<typeof CheckboxCardImage>\n\nexport const CheckboxCard = forwardRef<HTMLLabelElement, CheckboxProps>((props, ref) => {\n const [variantProps, checkboxProps] = checkboxCard.splitVariantProps(props)\n const [cssProps, localProps] = splitCssProps(checkboxProps)\n const { children, className, ...rootProps } = localProps\n const styles = checkboxCard(variantProps)\n\n return (\n <CheckboxCardRoot\n ref={ref}\n className={cx(styles.root, css(cssProps), className)}\n {...rootProps}\n value={rootProps.value as string | undefined}\n >\n <ArkCheckbox.Control className={styles.control}>\n <ArkCheckbox.Indicator>\n <CheckIcon />\n </ArkCheckbox.Indicator>\n <ArkCheckbox.Indicator indeterminate>\n <MinusIcon />\n </ArkCheckbox.Indicator>\n </ArkCheckbox.Control>\n {children}\n <ArkCheckbox.HiddenInput />\n </CheckboxCardRoot>\n )\n})\n\nCheckboxCard.displayName = 'CheckboxCard'\n"],"mappings":";;;;;;;;;;AAgBA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,GAAc,EACrE,UAAU,GACZ,CAAC,GAGK,KAAoD,MACxD,EAAO,CAAG,GAEN,IAAmB,EAAa,EAAO,EAAY,IAAI,CAAC,GAEjD,IAAoB,EAAY,EAAO,EAAY,KAAK,GAAG,OAAO,GAClE,IAAsB,EAAY,EAAU,KAAK,GAAG,SAAS,GAC7D,IAA0B,EAAY,EAAU,GAAG,GAAG,aAAa,GACnE,IAAoB,EAAY,EAAO,EAAI,GAAG,GAAG,OAAO,GAOxD,IAAe,GAA6C,GAAO,MAAQ;CACtF,IAAM,CAAC,GAAc,KAAiB,EAAa,kBAAkB,CAAK,GACpE,CAAC,GAAU,KAAc,EAAc,CAAa,GACpD,EAAE,aAAU,cAAW,GAAG,MAAc,GACxC,IAAS,EAAa,CAAY;CAExC,OACE,kBAAC,GAAD;EACO;EACL,WAAW,EAAG,EAAO,MAAM,EAAI,CAAQ,GAAG,CAAS;EACnD,GAAI;EACJ,OAAO,EAAU;YAJnB;GAME,kBAAC,EAAY,SAAb;IAAqB,WAAW,EAAO;cAAvC,CACE,kBAAC,EAAY,WAAb,EAAA,UACE,kBAAC,GAAD,CAAY,CAAA,EACS,CAAA,GACvB,kBAAC,EAAY,WAAb;KAAuB,eAAA;eACrB,kBAAC,GAAD,CAAY,CAAA;IACS,CAAA,CACJ;;GACpB;GACD,kBAAC,EAAY,aAAb,CAA0B,CAAA;EACV;;AAEtB,CAAC;AAED,EAAa,cAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../utils/slots.cjs"),t=require("../icon-button/IconButton.cjs");let n=require("@ark-ui/react"),r=require("@stokelp/styled-system/jsx"),i=require("@stokelp/styled-system/recipes"),a=require("react"),o=require("react/jsx-runtime"),s=require("usehooks-ts"),c=require("@stokelp/styled-system/tokens");var{withProvider:l,withContext:u}=e.createStyleContext(i.drawer),d=l(n.Dialog.Root,void 0,{defaultProps:{unmountOnExit:!0,lazyMount:!0}}),f=u((0,r.styled)(n.ark.main),`body`),p=u((0,r.styled)(n.Dialog.CloseTrigger),`closeTrigger`),m=u((0,r.styled)(n.ark.footer),`footer`),h=(0,a.forwardRef)(({children:e,showCloseTrigger:r=!0,...i},a)=>(0,o.jsxs)(n.ark.header,{...i,ref:a,children:[e,r&&(0,o.jsx)(p,{asChild:!0,children:(0,o.jsx)(t.IconButton,{ml:`auto`,"aria-label":`close`,variant:`tertiary`,children:(0,o.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,o.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z`,fill:`currentColor`})})})})]}));h.displayName=`DrawerHeader`;var g=u(h,`header`),_=u((0,r.styled)(n.Dialog.Title),`title`),v=u((0,r.styled)(n.Dialog.Trigger),`trigger`),y=u((0,r.styled)(n.Dialog.Positioner),`positioner`),b=u((0,r.styled)(n.Dialog.Backdrop),`backdrop`),x=(0,a.forwardRef)(({children:e,...t},r)=>{let i=(0,s.useMediaQuery)(`(max-width: ${(0,c.token)(`breakpoints.md`)})`,{defaultValue:!1}),{open:l,getContentProps:u}=(0,n.useDialogContext)();return(0,a.useLayoutEffect)(()=>{if(!l)return;let{id:e}=u();if(!e)return;let t=document.getElementById(e);if(t){let e=t.querySelector(`footer`);e&&(i?t.style.setProperty(`--footer-height`,`${Math.ceil(e.clientHeight)}px`):t.style.setProperty(`--footer-height`,`70px`))}},[l,i]),(0,a.useEffect)(()=>{
|
|
1
|
+
"use client";const e=require("../../utils/slots.cjs"),t=require("../icon-button/IconButton.cjs");let n=require("@ark-ui/react"),r=require("@stokelp/styled-system/jsx"),i=require("@stokelp/styled-system/recipes"),a=require("react"),o=require("react/jsx-runtime"),s=require("usehooks-ts"),c=require("@stokelp/styled-system/tokens");var{withProvider:l,withContext:u}=e.createStyleContext(i.drawer),d=l(n.Dialog.Root,void 0,{defaultProps:{unmountOnExit:!0,lazyMount:!0}}),f=u((0,r.styled)(n.ark.main),`body`),p=u((0,r.styled)(n.Dialog.CloseTrigger),`closeTrigger`),m=u((0,r.styled)(n.ark.footer),`footer`),h=(0,a.forwardRef)(({children:e,showCloseTrigger:r=!0,...i},a)=>(0,o.jsxs)(n.ark.header,{...i,ref:a,children:[e,r&&(0,o.jsx)(p,{asChild:!0,children:(0,o.jsx)(t.IconButton,{ml:`auto`,"aria-label":`close`,variant:`tertiary`,children:(0,o.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,o.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z`,fill:`currentColor`})})})})]}));h.displayName=`DrawerHeader`;var g=u(h,`header`),_=u((0,r.styled)(n.Dialog.Title),`title`),v=u((0,r.styled)(n.Dialog.Trigger),`trigger`),y=u((0,r.styled)(n.Dialog.Positioner),`positioner`),b=u((0,r.styled)(n.Dialog.Backdrop),`backdrop`),x=(0,a.forwardRef)(({children:e,...t},r)=>{let i=(0,s.useMediaQuery)(`(max-width: ${(0,c.token)(`breakpoints.md`)})`,{defaultValue:!1}),{open:l,getContentProps:u}=(0,n.useDialogContext)();return(0,a.useLayoutEffect)(()=>{if(!l)return;let{id:e}=u();if(!e)return;let t=document.getElementById(e);if(t){let e=t.querySelector(`footer`);e&&(i?t.style.setProperty(`--footer-height`,`${Math.ceil(e.clientHeight)}px`):t.style.setProperty(`--footer-height`,`70px`))}},[l,i]),(0,a.useEffect)(()=>{process.env.NODE_ENV!==`production`&&(l||window.setTimeout(()=>{let e=document.body;document.querySelector(`[data-scope="dialog"][data-state="open"]`)||(e.style.pointerEvents===`none`&&(e.style.pointerEvents=``),e.hasAttribute(`data-inert`)&&e.removeAttribute(`data-inert`),e.getAttribute(`style`)===``&&e.removeAttribute(`style`))},350))},[l]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(b,{}),(0,o.jsx)(y,{children:(0,o.jsx)(n.Dialog.Content,{ref:r,...t,children:e})})]})});x.displayName=n.Dialog.Content.displayName;var S=u((0,r.styled)(x),`content`),C=n.Dialog.Context;exports.Drawer=d,exports.DrawerBody=f,exports.DrawerCloseTrigger=p,exports.DrawerContent=S,exports.DrawerContext=C,exports.DrawerFooter=m,exports.DrawerHeader=g,exports.DrawerTitle=_,exports.DrawerTrigger=v;
|
|
2
2
|
//# sourceMappingURL=Drawer.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.cjs","names":[],"sources":["../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import { ark, Dialog as ArkDrawer, useDialogContext } from '@ark-ui/react'\nimport { useMediaQuery } from 'usehooks-ts'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { drawer } from '@stokelp/styled-system/recipes'\nimport { token } from '@stokelp/styled-system/tokens'\nimport { ComponentProps, ComponentPropsWithoutRef, ElementRef, forwardRef, useEffect, useLayoutEffect } from 'react'\n\nimport { createStyleContext } from '~/utils/slots'\nimport { IconButton } from '~/components/icon-button'\n\nconst { withProvider, withContext } = createStyleContext(drawer)\n\nexport const Drawer = withProvider(ArkDrawer.Root, undefined, {\n defaultProps: {\n unmountOnExit: true,\n lazyMount: true,\n },\n})\nexport const DrawerBody = withContext(styled(ark.main), 'body')\nexport const DrawerCloseTrigger = withContext(styled(ArkDrawer.CloseTrigger), 'closeTrigger')\nexport const DrawerFooter = withContext(styled(ark.footer), 'footer')\n\ntype HeaderProps = ComponentPropsWithoutRef<typeof ark.header> & {\n showCloseTrigger?: boolean\n}\n\nconst Header = forwardRef<ElementRef<typeof ark.header>, HeaderProps>(\n ({ children, showCloseTrigger = true, ...props }, ref) => (\n <ark.header {...props} ref={ref}>\n {children}\n {showCloseTrigger && (\n <DrawerCloseTrigger asChild>\n <IconButton ml=\"auto\" aria-label=\"close\" variant=\"tertiary\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n </DrawerCloseTrigger>\n )}\n </ark.header>\n ),\n)\nHeader.displayName = 'DrawerHeader'\n\nexport const DrawerHeader = withContext(Header, 'header')\nexport const DrawerTitle = withContext(styled(ArkDrawer.Title), 'title')\nexport const DrawerTrigger = withContext(styled(ArkDrawer.Trigger), 'trigger')\n\nconst DrawerPositioner = withContext(styled(ArkDrawer.Positioner), 'positioner')\nconst DrawerBackdrop = withContext(styled(ArkDrawer.Backdrop), 'backdrop')\n\nconst Content = forwardRef<ElementRef<typeof ArkDrawer.Content>, ComponentPropsWithoutRef<typeof ArkDrawer.Content>>(\n ({ children, ...props }, ref) => {\n const isMobile = useMediaQuery(`(max-width: ${token('breakpoints.md')})`, {\n defaultValue: false,\n })\n const { open, getContentProps } = useDialogContext()\n\n useLayoutEffect(() => {\n if (!open) return\n const { id } = getContentProps()\n if (!id) return\n const $content = document.getElementById(id)\n if ($content) {\n const $footer = $content.querySelector('footer')\n if ($footer) {\n if (isMobile) {\n $content.style.setProperty('--footer-height', `${Math.ceil($footer.clientHeight)}px`)\n } else {\n $content.style.setProperty('--footer-height', `70px`)\n }\n }\n }\n }, [open, isMobile])\n\n // Workaround: in React StrictMode (Next.js dev), @zag-js/dismissable's\n // disablePointerEventsOutside cleanup can leave `<body>` with\n // `pointer-events: none` / `data-inert`, freezing the page after close.\n // Gated inside the effect body so consumer bundlers DCE it in production.\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') return\n if (open) return\n
|
|
1
|
+
{"version":3,"file":"Drawer.cjs","names":[],"sources":["../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import { ark, Dialog as ArkDrawer, useDialogContext } from '@ark-ui/react'\nimport { useMediaQuery } from 'usehooks-ts'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { drawer } from '@stokelp/styled-system/recipes'\nimport { token } from '@stokelp/styled-system/tokens'\nimport { ComponentProps, ComponentPropsWithoutRef, ElementRef, forwardRef, useEffect, useLayoutEffect } from 'react'\n\nimport { createStyleContext } from '~/utils/slots'\nimport { IconButton } from '~/components/icon-button'\n\nconst { withProvider, withContext } = createStyleContext(drawer)\n\nexport const Drawer = withProvider(ArkDrawer.Root, undefined, {\n defaultProps: {\n unmountOnExit: true,\n lazyMount: true,\n },\n})\nexport const DrawerBody = withContext(styled(ark.main), 'body')\nexport const DrawerCloseTrigger = withContext(styled(ArkDrawer.CloseTrigger), 'closeTrigger')\nexport const DrawerFooter = withContext(styled(ark.footer), 'footer')\n\ntype HeaderProps = ComponentPropsWithoutRef<typeof ark.header> & {\n showCloseTrigger?: boolean\n}\n\nconst Header = forwardRef<ElementRef<typeof ark.header>, HeaderProps>(\n ({ children, showCloseTrigger = true, ...props }, ref) => (\n <ark.header {...props} ref={ref}>\n {children}\n {showCloseTrigger && (\n <DrawerCloseTrigger asChild>\n <IconButton ml=\"auto\" aria-label=\"close\" variant=\"tertiary\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n </DrawerCloseTrigger>\n )}\n </ark.header>\n ),\n)\nHeader.displayName = 'DrawerHeader'\n\nexport const DrawerHeader = withContext(Header, 'header')\nexport const DrawerTitle = withContext(styled(ArkDrawer.Title), 'title')\nexport const DrawerTrigger = withContext(styled(ArkDrawer.Trigger), 'trigger')\n\nconst DrawerPositioner = withContext(styled(ArkDrawer.Positioner), 'positioner')\nconst DrawerBackdrop = withContext(styled(ArkDrawer.Backdrop), 'backdrop')\n\nconst Content = forwardRef<ElementRef<typeof ArkDrawer.Content>, ComponentPropsWithoutRef<typeof ArkDrawer.Content>>(\n ({ children, ...props }, ref) => {\n const isMobile = useMediaQuery(`(max-width: ${token('breakpoints.md')})`, {\n defaultValue: false,\n })\n const { open, getContentProps } = useDialogContext()\n\n useLayoutEffect(() => {\n if (!open) return\n const { id } = getContentProps()\n if (!id) return\n const $content = document.getElementById(id)\n if ($content) {\n const $footer = $content.querySelector('footer')\n if ($footer) {\n if (isMobile) {\n $content.style.setProperty('--footer-height', `${Math.ceil($footer.clientHeight)}px`)\n } else {\n $content.style.setProperty('--footer-height', `70px`)\n }\n }\n }\n }, [open, isMobile])\n\n // Workaround: in React StrictMode (Next.js dev), @zag-js/dismissable's\n // disablePointerEventsOutside cleanup can leave `<body>` with\n // `pointer-events: none` / `data-inert`, freezing the page after close.\n // Gated inside the effect body so consumer bundlers DCE it in production.\n // The timer is intentionally fire-and-forget — with unmountOnExit, Content\n // unmounts after the exit animation (~200ms), so a cleanup-bound timer\n // would be canceled before it fires. The restore is idempotent and the\n // stillOpen guard prevents it from clobbering a freshly-opened dialog.\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') return\n if (open) return\n window.setTimeout(() => {\n const body = document.body\n const stillOpen = document.querySelector('[data-scope=\"dialog\"][data-state=\"open\"]')\n if (stillOpen) return\n if (body.style.pointerEvents === 'none') body.style.pointerEvents = ''\n if (body.hasAttribute('data-inert')) body.removeAttribute('data-inert')\n if (body.getAttribute('style') === '') body.removeAttribute('style')\n }, 350)\n }, [open])\n\n return (\n <>\n <DrawerBackdrop />\n <DrawerPositioner>\n <ArkDrawer.Content ref={ref} {...props}>\n {children}\n </ArkDrawer.Content>\n </DrawerPositioner>\n </>\n )\n },\n)\nContent.displayName = ArkDrawer.Content.displayName\n\nexport const DrawerContent = withContext(styled(Content), 'content')\nexport const DrawerContext = ArkDrawer.Context\n\nexport interface DrawerProps extends ComponentProps<typeof Drawer> {}\nexport interface DrawerBackdropProps extends ComponentProps<typeof DrawerBackdrop> {}\nexport interface DrawerBodyProps extends ComponentProps<typeof DrawerBody> {}\nexport interface DrawerCloseTriggerProps extends ComponentProps<typeof DrawerCloseTrigger> {}\nexport interface DrawerContentProps extends ComponentProps<typeof DrawerContent> {}\nexport interface DrawerFooterProps extends ComponentProps<typeof DrawerFooter> {}\nexport interface DrawerHeaderProps extends ComponentProps<typeof DrawerHeader> {}\nexport interface DrawerPositionerProps extends ComponentProps<typeof DrawerPositioner> {}\nexport interface DrawerTitleProps extends ComponentProps<typeof DrawerTitle> {}\nexport interface DrawerTriggerProps extends ComponentProps<typeof DrawerTrigger> {}\nexport interface DrawerContextProps extends ComponentProps<typeof DrawerContext> {}\n"],"mappings":"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"}
|
|
@@ -50,12 +50,10 @@ var S = g(x, "header"), C = g(a(n.Title), "title"), w = g(a(n.Trigger), "trigger
|
|
|
50
50
|
e && (a ? t.style.setProperty("--footer-height", `${Math.ceil(e.clientHeight)}px`) : t.style.setProperty("--footer-height", "70px"));
|
|
51
51
|
}
|
|
52
52
|
}, [o, a]), c(() => {
|
|
53
|
-
|
|
54
|
-
let e = window.setTimeout(() => {
|
|
53
|
+
process.env.NODE_ENV !== "production" && (o || window.setTimeout(() => {
|
|
55
54
|
let e = document.body;
|
|
56
55
|
document.querySelector("[data-scope=\"dialog\"][data-state=\"open\"]") || (e.style.pointerEvents === "none" && (e.style.pointerEvents = ""), e.hasAttribute("data-inert") && e.removeAttribute("data-inert"), e.getAttribute("style") === "" && e.removeAttribute("style"));
|
|
57
|
-
}, 350);
|
|
58
|
-
return () => window.clearTimeout(e);
|
|
56
|
+
}, 350));
|
|
59
57
|
}, [o]), /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(E, {}), /* @__PURE__ */ d(T, { children: /* @__PURE__ */ d(n.Content, {
|
|
60
58
|
ref: r,
|
|
61
59
|
...t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","names":[],"sources":["../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import { ark, Dialog as ArkDrawer, useDialogContext } from '@ark-ui/react'\nimport { useMediaQuery } from 'usehooks-ts'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { drawer } from '@stokelp/styled-system/recipes'\nimport { token } from '@stokelp/styled-system/tokens'\nimport { ComponentProps, ComponentPropsWithoutRef, ElementRef, forwardRef, useEffect, useLayoutEffect } from 'react'\n\nimport { createStyleContext } from '~/utils/slots'\nimport { IconButton } from '~/components/icon-button'\n\nconst { withProvider, withContext } = createStyleContext(drawer)\n\nexport const Drawer = withProvider(ArkDrawer.Root, undefined, {\n defaultProps: {\n unmountOnExit: true,\n lazyMount: true,\n },\n})\nexport const DrawerBody = withContext(styled(ark.main), 'body')\nexport const DrawerCloseTrigger = withContext(styled(ArkDrawer.CloseTrigger), 'closeTrigger')\nexport const DrawerFooter = withContext(styled(ark.footer), 'footer')\n\ntype HeaderProps = ComponentPropsWithoutRef<typeof ark.header> & {\n showCloseTrigger?: boolean\n}\n\nconst Header = forwardRef<ElementRef<typeof ark.header>, HeaderProps>(\n ({ children, showCloseTrigger = true, ...props }, ref) => (\n <ark.header {...props} ref={ref}>\n {children}\n {showCloseTrigger && (\n <DrawerCloseTrigger asChild>\n <IconButton ml=\"auto\" aria-label=\"close\" variant=\"tertiary\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n </DrawerCloseTrigger>\n )}\n </ark.header>\n ),\n)\nHeader.displayName = 'DrawerHeader'\n\nexport const DrawerHeader = withContext(Header, 'header')\nexport const DrawerTitle = withContext(styled(ArkDrawer.Title), 'title')\nexport const DrawerTrigger = withContext(styled(ArkDrawer.Trigger), 'trigger')\n\nconst DrawerPositioner = withContext(styled(ArkDrawer.Positioner), 'positioner')\nconst DrawerBackdrop = withContext(styled(ArkDrawer.Backdrop), 'backdrop')\n\nconst Content = forwardRef<ElementRef<typeof ArkDrawer.Content>, ComponentPropsWithoutRef<typeof ArkDrawer.Content>>(\n ({ children, ...props }, ref) => {\n const isMobile = useMediaQuery(`(max-width: ${token('breakpoints.md')})`, {\n defaultValue: false,\n })\n const { open, getContentProps } = useDialogContext()\n\n useLayoutEffect(() => {\n if (!open) return\n const { id } = getContentProps()\n if (!id) return\n const $content = document.getElementById(id)\n if ($content) {\n const $footer = $content.querySelector('footer')\n if ($footer) {\n if (isMobile) {\n $content.style.setProperty('--footer-height', `${Math.ceil($footer.clientHeight)}px`)\n } else {\n $content.style.setProperty('--footer-height', `70px`)\n }\n }\n }\n }, [open, isMobile])\n\n // Workaround: in React StrictMode (Next.js dev), @zag-js/dismissable's\n // disablePointerEventsOutside cleanup can leave `<body>` with\n // `pointer-events: none` / `data-inert`, freezing the page after close.\n // Gated inside the effect body so consumer bundlers DCE it in production.\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') return\n if (open) return\n
|
|
1
|
+
{"version":3,"file":"Drawer.js","names":[],"sources":["../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import { ark, Dialog as ArkDrawer, useDialogContext } from '@ark-ui/react'\nimport { useMediaQuery } from 'usehooks-ts'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { drawer } from '@stokelp/styled-system/recipes'\nimport { token } from '@stokelp/styled-system/tokens'\nimport { ComponentProps, ComponentPropsWithoutRef, ElementRef, forwardRef, useEffect, useLayoutEffect } from 'react'\n\nimport { createStyleContext } from '~/utils/slots'\nimport { IconButton } from '~/components/icon-button'\n\nconst { withProvider, withContext } = createStyleContext(drawer)\n\nexport const Drawer = withProvider(ArkDrawer.Root, undefined, {\n defaultProps: {\n unmountOnExit: true,\n lazyMount: true,\n },\n})\nexport const DrawerBody = withContext(styled(ark.main), 'body')\nexport const DrawerCloseTrigger = withContext(styled(ArkDrawer.CloseTrigger), 'closeTrigger')\nexport const DrawerFooter = withContext(styled(ark.footer), 'footer')\n\ntype HeaderProps = ComponentPropsWithoutRef<typeof ark.header> & {\n showCloseTrigger?: boolean\n}\n\nconst Header = forwardRef<ElementRef<typeof ark.header>, HeaderProps>(\n ({ children, showCloseTrigger = true, ...props }, ref) => (\n <ark.header {...props} ref={ref}>\n {children}\n {showCloseTrigger && (\n <DrawerCloseTrigger asChild>\n <IconButton ml=\"auto\" aria-label=\"close\" variant=\"tertiary\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n </DrawerCloseTrigger>\n )}\n </ark.header>\n ),\n)\nHeader.displayName = 'DrawerHeader'\n\nexport const DrawerHeader = withContext(Header, 'header')\nexport const DrawerTitle = withContext(styled(ArkDrawer.Title), 'title')\nexport const DrawerTrigger = withContext(styled(ArkDrawer.Trigger), 'trigger')\n\nconst DrawerPositioner = withContext(styled(ArkDrawer.Positioner), 'positioner')\nconst DrawerBackdrop = withContext(styled(ArkDrawer.Backdrop), 'backdrop')\n\nconst Content = forwardRef<ElementRef<typeof ArkDrawer.Content>, ComponentPropsWithoutRef<typeof ArkDrawer.Content>>(\n ({ children, ...props }, ref) => {\n const isMobile = useMediaQuery(`(max-width: ${token('breakpoints.md')})`, {\n defaultValue: false,\n })\n const { open, getContentProps } = useDialogContext()\n\n useLayoutEffect(() => {\n if (!open) return\n const { id } = getContentProps()\n if (!id) return\n const $content = document.getElementById(id)\n if ($content) {\n const $footer = $content.querySelector('footer')\n if ($footer) {\n if (isMobile) {\n $content.style.setProperty('--footer-height', `${Math.ceil($footer.clientHeight)}px`)\n } else {\n $content.style.setProperty('--footer-height', `70px`)\n }\n }\n }\n }, [open, isMobile])\n\n // Workaround: in React StrictMode (Next.js dev), @zag-js/dismissable's\n // disablePointerEventsOutside cleanup can leave `<body>` with\n // `pointer-events: none` / `data-inert`, freezing the page after close.\n // Gated inside the effect body so consumer bundlers DCE it in production.\n // The timer is intentionally fire-and-forget — with unmountOnExit, Content\n // unmounts after the exit animation (~200ms), so a cleanup-bound timer\n // would be canceled before it fires. The restore is idempotent and the\n // stillOpen guard prevents it from clobbering a freshly-opened dialog.\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') return\n if (open) return\n window.setTimeout(() => {\n const body = document.body\n const stillOpen = document.querySelector('[data-scope=\"dialog\"][data-state=\"open\"]')\n if (stillOpen) return\n if (body.style.pointerEvents === 'none') body.style.pointerEvents = ''\n if (body.hasAttribute('data-inert')) body.removeAttribute('data-inert')\n if (body.getAttribute('style') === '') body.removeAttribute('style')\n }, 350)\n }, [open])\n\n return (\n <>\n <DrawerBackdrop />\n <DrawerPositioner>\n <ArkDrawer.Content ref={ref} {...props}>\n {children}\n </ArkDrawer.Content>\n </DrawerPositioner>\n </>\n )\n },\n)\nContent.displayName = ArkDrawer.Content.displayName\n\nexport const DrawerContent = withContext(styled(Content), 'content')\nexport const DrawerContext = ArkDrawer.Context\n\nexport interface DrawerProps extends ComponentProps<typeof Drawer> {}\nexport interface DrawerBackdropProps extends ComponentProps<typeof DrawerBackdrop> {}\nexport interface DrawerBodyProps extends ComponentProps<typeof DrawerBody> {}\nexport interface DrawerCloseTriggerProps extends ComponentProps<typeof DrawerCloseTrigger> {}\nexport interface DrawerContentProps extends ComponentProps<typeof DrawerContent> {}\nexport interface DrawerFooterProps extends ComponentProps<typeof DrawerFooter> {}\nexport interface DrawerHeaderProps extends ComponentProps<typeof DrawerHeader> {}\nexport interface DrawerPositionerProps extends ComponentProps<typeof DrawerPositioner> {}\nexport interface DrawerTitleProps extends ComponentProps<typeof DrawerTitle> {}\nexport interface DrawerTriggerProps extends ComponentProps<typeof DrawerTrigger> {}\nexport interface DrawerContextProps extends ComponentProps<typeof DrawerContext> {}\n"],"mappings":";;;;;;;;;;;AAUA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,CAAM,GAElD,IAAS,EAAa,EAAU,MAAM,KAAA,GAAW,EAC5D,cAAc;CACZ,eAAe;CACf,WAAW;AACb,EACF,CAAC,GACY,IAAa,EAAY,EAAO,EAAI,IAAI,GAAG,MAAM,GACjD,IAAqB,EAAY,EAAO,EAAU,YAAY,GAAG,cAAc,GAC/E,IAAe,EAAY,EAAO,EAAI,MAAM,GAAG,QAAQ,GAM9D,IAAS,GACZ,EAAE,aAAU,sBAAmB,IAAM,GAAG,KAAS,MAChD,kBAAC,EAAI,QAAL;CAAY,GAAI;CAAY;WAA5B,CACG,GACA,KACC,kBAAC,GAAD;EAAoB,SAAA;YAClB,kBAAC,GAAD;GAAY,IAAG;GAAO,cAAW;GAAQ,SAAQ;aAC/C,kBAAC,OAAD;IAAK,OAAM;IAAK,QAAO;IAAK,SAAQ;IAAY,MAAK;IAAO,OAAM;cAChE,kBAAC,QAAD;KACE,UAAS;KACT,UAAS;KACT,GAAE;KACF,MAAK;IACN,CAAA;GACE,CAAA;EACK,CAAA;CACM,CAAA,CAEZ;EAEhB;AACA,EAAO,cAAc;AAErB,IAAa,IAAe,EAAY,GAAQ,QAAQ,GAC3C,IAAc,EAAY,EAAO,EAAU,KAAK,GAAG,OAAO,GAC1D,IAAgB,EAAY,EAAO,EAAU,OAAO,GAAG,SAAS,GAEvE,IAAmB,EAAY,EAAO,EAAU,UAAU,GAAG,YAAY,GACzE,IAAiB,EAAY,EAAO,EAAU,QAAQ,GAAG,UAAU,GAEnE,IAAU,GACb,EAAE,aAAU,GAAG,KAAS,MAAQ;CAC/B,IAAM,IAAW,EAAc,eAAe,EAAM,gBAAgB,EAAE,IAAI,EACxE,cAAc,GAChB,CAAC,GACK,EAAE,SAAM,uBAAoB,EAAiB;CAwCnD,OAtCA,QAAsB;EACpB,IAAI,CAAC,GAAM;EACX,IAAM,EAAE,UAAO,EAAgB;EAC/B,IAAI,CAAC,GAAI;EACT,IAAM,IAAW,SAAS,eAAe,CAAE;EAC3C,IAAI,GAAU;GACZ,IAAM,IAAU,EAAS,cAAc,QAAQ;GAC/C,AAAI,MACE,IACF,EAAS,MAAM,YAAY,mBAAmB,GAAG,KAAK,KAAK,EAAQ,YAAY,EAAE,GAAG,IAEpF,EAAS,MAAM,YAAY,mBAAmB,MAAM;EAG1D;CACF,GAAG,CAAC,GAAM,CAAQ,CAAC,GAUnB,QAAgB;EACd,QAAA,IAAA,aAA6B,iBACzB,KACJ,OAAO,iBAAiB;GACtB,IAAM,IAAO,SAAS;GACJ,SAAS,cAAc,8CACrC,MACA,EAAK,MAAM,kBAAkB,WAAQ,EAAK,MAAM,gBAAgB,KAChE,EAAK,aAAa,YAAY,KAAG,EAAK,gBAAgB,YAAY,GAClE,EAAK,aAAa,OAAO,MAAM,MAAI,EAAK,gBAAgB,OAAO;EACrE,GAAG,GAAG;CACR,GAAG,CAAC,CAAI,CAAC,GAGP,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,CAAiB,CAAA,GACjB,kBAAC,GAAD,EAAA,UACE,kBAAC,EAAU,SAAX;EAAwB;EAAK,GAAI;EAC9B;CACgB,CAAA,EACH,CAAA,CAClB,EAAA,CAAA;AAEN,CACF;AACA,EAAQ,cAAc,EAAU,QAAQ;AAExC,IAAa,IAAgB,EAAY,EAAO,CAAO,GAAG,SAAS,GACtD,IAAgB,EAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.cjs","names":[],"sources":["../../../src/components/form/FormControl.tsx"],"sourcesContent":["import type { ComponentProps, FC } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { formControl } from '@stokelp/styled-system/recipes'\n\nconst StyledFormControl = styled('div', formControl, {\n defaultProps: {\n role: 'group',\n },\n})
|
|
1
|
+
{"version":3,"file":"FormControl.cjs","names":[],"sources":["../../../src/components/form/FormControl.tsx"],"sourcesContent":["import type { ComponentProps, FC } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { formControl, type FormControlVariantProps } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\n\n// Explicit `as` cast pins the literal `'div'` against TS's d.ts emit-time\n// widening (which would otherwise produce `StyledComponent<string, …>` and\n// strip every native HTML attribute — children, id, role, aria-*, etc. —\n// from consumer typings). Same pattern as IconButton.tsx.\nconst StyledFormControl = styled('div', formControl, {\n defaultProps: {\n role: 'group',\n },\n}) as StyledComponent<'div', FormControlVariantProps>\n\nexport type FormControlProps = ComponentProps<typeof StyledFormControl> & {\n isInvalid?: boolean\n isRequired?: boolean\n}\n\nexport const FormControl: FC<FormControlProps> = ({ isInvalid, isRequired, ...props }) => {\n const invalidProps = {\n ...(isInvalid ? { 'aria-invalid': true } : {}),\n ...(isRequired ? { 'aria-required': true } : {}),\n }\n\n return <StyledFormControl {...invalidProps} {...props} />\n}\n"],"mappings":"oIAUA,IAAM,GAAA,EAAA,EAAA,QAA2B,MAAO,EAAA,YAAa,CACnD,aAAc,CACZ,KAAM,OACR,CACF,CAAC,EAOY,GAAqC,CAAE,YAAW,aAAY,GAAG,MAMrE,EAAA,EAAA,KAAC,EAAD,CAJL,GAAI,EAAY,CAAE,eAAgB,EAAK,EAAI,CAAC,EAC5C,GAAI,EAAa,CAAE,gBAAiB,EAAK,EAAI,CAAC,EAGJ,GAAI,CAAQ,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, FC } from 'react';
|
|
2
|
-
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
3
2
|
import { FormControlVariantProps } from '@stokelp/styled-system/recipes';
|
|
4
|
-
|
|
3
|
+
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
4
|
+
declare const StyledFormControl: StyledComponent<"div", FormControlVariantProps>;
|
|
5
5
|
export type FormControlProps = ComponentProps<typeof StyledFormControl> & {
|
|
6
6
|
isInvalid?: boolean;
|
|
7
7
|
isRequired?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.js","names":[],"sources":["../../../src/components/form/FormControl.tsx"],"sourcesContent":["import type { ComponentProps, FC } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { formControl } from '@stokelp/styled-system/recipes'\n\nconst StyledFormControl = styled('div', formControl, {\n defaultProps: {\n role: 'group',\n },\n})
|
|
1
|
+
{"version":3,"file":"FormControl.js","names":[],"sources":["../../../src/components/form/FormControl.tsx"],"sourcesContent":["import type { ComponentProps, FC } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { formControl, type FormControlVariantProps } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\n\n// Explicit `as` cast pins the literal `'div'` against TS's d.ts emit-time\n// widening (which would otherwise produce `StyledComponent<string, …>` and\n// strip every native HTML attribute — children, id, role, aria-*, etc. —\n// from consumer typings). Same pattern as IconButton.tsx.\nconst StyledFormControl = styled('div', formControl, {\n defaultProps: {\n role: 'group',\n },\n}) as StyledComponent<'div', FormControlVariantProps>\n\nexport type FormControlProps = ComponentProps<typeof StyledFormControl> & {\n isInvalid?: boolean\n isRequired?: boolean\n}\n\nexport const FormControl: FC<FormControlProps> = ({ isInvalid, isRequired, ...props }) => {\n const invalidProps = {\n ...(isInvalid ? { 'aria-invalid': true } : {}),\n ...(isRequired ? { 'aria-required': true } : {}),\n }\n\n return <StyledFormControl {...invalidProps} {...props} />\n}\n"],"mappings":";;;;;AAUA,IAAM,IAAoB,EAAO,OAAO,GAAa,EACnD,cAAc,EACZ,MAAM,QACR,EACF,CAAC,GAOY,KAAqC,EAAE,cAAW,eAAY,GAAG,QAMrE,kBAAC,GAAD;CAJL,GAAI,IAAY,EAAE,gBAAgB,GAAK,IAAI,CAAC;CAC5C,GAAI,IAAa,EAAE,iBAAiB,GAAK,IAAI,CAAC;CAGJ,GAAI;AAAQ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormHelperText.cjs","names":[],"sources":["../../../src/components/form/FormHelperText.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { formHelperText } from '@stokelp/styled-system/recipes'\n\nexport const FormHelperText = styled('p', formHelperText, {\n dataAttr: true,\n})
|
|
1
|
+
{"version":3,"file":"FormHelperText.cjs","names":[],"sources":["../../../src/components/form/FormHelperText.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { formHelperText, type FormHelperTextVariantProps } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\n\n// See FormControl.tsx for why we pin the literal tag with an `as` cast.\nexport const FormHelperText = styled('p', formHelperText, {\n dataAttr: true,\n}) as StyledComponent<'p', FormHelperTextVariantProps>\n\nexport interface FormHelperTextProps extends ComponentProps<typeof FormHelperText> {}\n"],"mappings":"qGAOA,IAAa,GAAA,EAAA,EAAA,QAAwB,IAAK,EAAA,eAAgB,CACxD,SAAU,EACZ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
3
2
|
import { FormHelperTextVariantProps } from '@stokelp/styled-system/recipes';
|
|
4
|
-
|
|
3
|
+
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
4
|
+
export declare const FormHelperText: StyledComponent<"p", FormHelperTextVariantProps>;
|
|
5
5
|
export interface FormHelperTextProps extends ComponentProps<typeof FormHelperText> {
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormHelperText.js","names":[],"sources":["../../../src/components/form/FormHelperText.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { formHelperText } from '@stokelp/styled-system/recipes'\n\nexport const FormHelperText = styled('p', formHelperText, {\n dataAttr: true,\n})
|
|
1
|
+
{"version":3,"file":"FormHelperText.js","names":[],"sources":["../../../src/components/form/FormHelperText.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { formHelperText, type FormHelperTextVariantProps } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\n\n// See FormControl.tsx for why we pin the literal tag with an `as` cast.\nexport const FormHelperText = styled('p', formHelperText, {\n dataAttr: true,\n}) as StyledComponent<'p', FormHelperTextVariantProps>\n\nexport interface FormHelperTextProps extends ComponentProps<typeof FormHelperText> {}\n"],"mappings":";;;;AAOA,IAAa,IAAiB,EAAO,KAAK,GAAgB,EACxD,UAAU,GACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.cjs","names":[],"sources":["../../../src/components/form/FormLabel.tsx"],"sourcesContent":["import type { ComponentProps, FC, ReactNode } from 'react'\n\nimport { splitCssProps, styled } from '@stokelp/styled-system/jsx'\nimport { formLabel } from '@stokelp/styled-system/recipes'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\n\nconst StyledFormLabel = styled('label', formLabel)
|
|
1
|
+
{"version":3,"file":"FormLabel.cjs","names":[],"sources":["../../../src/components/form/FormLabel.tsx"],"sourcesContent":["import type { ComponentProps, FC, ReactNode } from 'react'\n\nimport { splitCssProps, styled } from '@stokelp/styled-system/jsx'\nimport { formLabel, type FormLabelVariantProps } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\n\n// See FormControl.tsx for why we pin the literal tag with an `as` cast.\nconst StyledFormLabel = styled('label', formLabel) as StyledComponent<'label', FormLabelVariantProps>\n\nexport type FormLabelProps = ComponentProps<typeof StyledFormLabel> & {\n addon?: ReactNode\n tooltipInformation?: ReactNode\n}\n\nexport const FormLabel: FC<FormLabelProps> = props => {\n const [variantProps, labelProps] = formLabel.splitVariantProps(props)\n const [cssProps, localProps] = splitCssProps(labelProps)\n const { children, className, addon, tooltipInformation, ...rootProps } = localProps\n const styles = formLabel(variantProps)\n\n return (\n <StyledFormLabel className={cx(styles.root, css(cssProps), className)} {...rootProps}>\n {children}\n {addon ? <span className={styles.addon}>{addon}</span> : null}\n {tooltipInformation ? (\n <Tooltip label={tooltipInformation}>\n <svg\n className={styles.icon}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7.33337 4.66659H8.66671V5.99992H7.33337V4.66659ZM7.33337 7.33325H8.66671V11.3333H7.33337V7.33325ZM8.00004 1.33325C4.32004 1.33325 1.33337 4.31992 1.33337 7.99992C1.33337 11.6799 4.32004 14.6666 8.00004 14.6666C11.68 14.6666 14.6667 11.6799 14.6667 7.99992C14.6667 4.31992 11.68 1.33325 8.00004 1.33325ZM8.00004 13.3333C5.06004 13.3333 2.66671 10.9399 2.66671 7.99992C2.66671 5.05992 5.06004 2.66659 8.00004 2.66659C10.94 2.66659 13.3334 5.05992 13.3334 7.99992C13.3334 10.9399 10.94 13.3333 8.00004 13.3333Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Tooltip>\n ) : null}\n </StyledFormLabel>\n )\n}\n"],"mappings":"sNASA,IAAM,GAAA,EAAA,EAAA,QAAyB,QAAS,EAAA,SAAS,EAOpC,EAAgC,GAAS,CACpD,GAAM,CAAC,EAAc,GAAc,EAAA,UAAU,kBAAkB,CAAK,EAC9D,CAAC,EAAU,IAAA,EAAA,EAAA,eAA4B,CAAU,EACjD,CAAE,WAAU,YAAW,QAAO,qBAAoB,GAAG,GAAc,EACnE,GAAA,EAAA,EAAA,WAAmB,CAAY,EAErC,OACE,EAAA,EAAA,MAAC,EAAD,CAAiB,WAAA,EAAA,EAAA,IAAc,EAAO,MAAA,EAAA,EAAA,KAAU,CAAQ,EAAG,CAAS,EAAG,GAAI,WAA3E,CACG,EACA,GAAQ,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAO,eAAQ,CAAY,CAAA,EAAI,KACxD,GACC,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,MAAO,YACd,EAAA,EAAA,KAAC,MAAD,CACE,UAAW,EAAO,KAClB,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,MAAM,uCAEN,EAAA,EAAA,KAAC,OAAD,CACE,EAAE,+fACF,KAAK,cACN,CAAA,CACE,CAAA,CACE,CAAA,EACP,IACW,GAErB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, FC, ReactNode } from 'react';
|
|
2
|
-
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
3
2
|
import { FormLabelVariantProps } from '@stokelp/styled-system/recipes';
|
|
4
|
-
|
|
3
|
+
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
4
|
+
declare const StyledFormLabel: StyledComponent<"label", FormLabelVariantProps>;
|
|
5
5
|
export type FormLabelProps = ComponentProps<typeof StyledFormLabel> & {
|
|
6
6
|
addon?: ReactNode;
|
|
7
7
|
tooltipInformation?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.js","names":[],"sources":["../../../src/components/form/FormLabel.tsx"],"sourcesContent":["import type { ComponentProps, FC, ReactNode } from 'react'\n\nimport { splitCssProps, styled } from '@stokelp/styled-system/jsx'\nimport { formLabel } from '@stokelp/styled-system/recipes'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\n\nconst StyledFormLabel = styled('label', formLabel)
|
|
1
|
+
{"version":3,"file":"FormLabel.js","names":[],"sources":["../../../src/components/form/FormLabel.tsx"],"sourcesContent":["import type { ComponentProps, FC, ReactNode } from 'react'\n\nimport { splitCssProps, styled } from '@stokelp/styled-system/jsx'\nimport { formLabel, type FormLabelVariantProps } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { css, cx } from '@stokelp/styled-system/css'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\n\n// See FormControl.tsx for why we pin the literal tag with an `as` cast.\nconst StyledFormLabel = styled('label', formLabel) as StyledComponent<'label', FormLabelVariantProps>\n\nexport type FormLabelProps = ComponentProps<typeof StyledFormLabel> & {\n addon?: ReactNode\n tooltipInformation?: ReactNode\n}\n\nexport const FormLabel: FC<FormLabelProps> = props => {\n const [variantProps, labelProps] = formLabel.splitVariantProps(props)\n const [cssProps, localProps] = splitCssProps(labelProps)\n const { children, className, addon, tooltipInformation, ...rootProps } = localProps\n const styles = formLabel(variantProps)\n\n return (\n <StyledFormLabel className={cx(styles.root, css(cssProps), className)} {...rootProps}>\n {children}\n {addon ? <span className={styles.addon}>{addon}</span> : null}\n {tooltipInformation ? (\n <Tooltip label={tooltipInformation}>\n <svg\n className={styles.icon}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7.33337 4.66659H8.66671V5.99992H7.33337V4.66659ZM7.33337 7.33325H8.66671V11.3333H7.33337V7.33325ZM8.00004 1.33325C4.32004 1.33325 1.33337 4.31992 1.33337 7.99992C1.33337 11.6799 4.32004 14.6666 8.00004 14.6666C11.68 14.6666 14.6667 11.6799 14.6667 7.99992C14.6667 4.31992 11.68 1.33325 8.00004 1.33325ZM8.00004 13.3333C5.06004 13.3333 2.66671 10.9399 2.66671 7.99992C2.66671 5.05992 5.06004 2.66659 8.00004 2.66659C10.94 2.66659 13.3334 5.05992 13.3334 7.99992C13.3334 10.9399 10.94 13.3333 8.00004 13.3333Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Tooltip>\n ) : null}\n </StyledFormLabel>\n )\n}\n"],"mappings":";;;;;;;AASA,IAAM,IAAkB,EAAO,SAAS,CAAS,GAOpC,KAAgC,MAAS;CACpD,IAAM,CAAC,GAAc,KAAc,EAAU,kBAAkB,CAAK,GAC9D,CAAC,GAAU,KAAc,EAAc,CAAU,GACjD,EAAE,aAAU,cAAW,UAAO,uBAAoB,GAAG,MAAc,GACnE,IAAS,EAAU,CAAY;CAErC,OACE,kBAAC,GAAD;EAAiB,WAAW,EAAG,EAAO,MAAM,EAAI,CAAQ,GAAG,CAAS;EAAG,GAAI;YAA3E;GACG;GACA,IAAQ,kBAAC,QAAD;IAAM,WAAW,EAAO;cAAQ;GAAY,CAAA,IAAI;GACxD,IACC,kBAAC,GAAD;IAAS,OAAO;cACd,kBAAC,OAAD;KACE,WAAW,EAAO;KAClB,OAAM;KACN,QAAO;KACP,SAAQ;KACR,MAAK;KACL,OAAM;eAEN,kBAAC,QAAD;MACE,GAAE;MACF,MAAK;KACN,CAAA;IACE,CAAA;GACE,CAAA,IACP;EACW;;AAErB"}
|
|
@@ -3,7 +3,7 @@ import { ComponentVariants } from '../../utils/slots';
|
|
|
3
3
|
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
4
4
|
import { HighlightedInputRecipe, InputVariantProps } from '@stokelp/styled-system/recipes';
|
|
5
5
|
export declare const Root: ComponentVariants<StyledComponent<string, {}>, HighlightedInputRecipe>;
|
|
6
|
-
export declare const InputSlot: StyledComponent<
|
|
6
|
+
export declare const InputSlot: StyledComponent<"input", InputVariantProps>;
|
|
7
7
|
export declare const Renderer: StyledComponent<string, {}>;
|
|
8
8
|
export declare const Highlight: StyledComponent<string, {}>;
|
|
9
9
|
export type HighlightedInputRootProps = ComponentProps<typeof Root>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.cjs","names":[],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import type { ComponentProps, WheelEvent } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { input } from '@stokelp/styled-system/recipes'\n\nexport const Input = styled('input', input, {\n defaultProps: {\n onWheel: (event: WheelEvent<HTMLInputElement>) => {\n if (event.currentTarget.type === 'number') {\n event.currentTarget.blur()\n }\n },\n },\n dataAttr: true,\n})
|
|
1
|
+
{"version":3,"file":"Input.cjs","names":[],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import type { ComponentProps, WheelEvent } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { input, type InputVariantProps } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\n\n// See FormControl.tsx for why we pin the literal tag with an `as` cast.\n// Without this, `Input` becomes `StyledComponent<string, …>` and loses every\n// native HTML input attribute (type, placeholder, value, ref, etc.) in the\n// emitted d.ts.\nexport const Input = styled('input', input, {\n defaultProps: {\n onWheel: (event: WheelEvent<HTMLInputElement>) => {\n if (event.currentTarget.type === 'number') {\n event.currentTarget.blur()\n }\n },\n },\n dataAttr: true,\n}) as StyledComponent<'input', InputVariantProps>\n\nexport type InputProps = ComponentProps<typeof Input>\n"],"mappings":"qGAUA,IAAa,GAAA,EAAA,EAAA,QAAe,QAAS,EAAA,MAAO,CAC1C,aAAc,CACZ,QAAU,GAAwC,CAC5C,EAAM,cAAc,OAAS,UAC/B,EAAM,cAAc,KAAK,CAE7B,CACF,EACA,SAAU,EACZ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
3
2
|
import { InputVariantProps } from '@stokelp/styled-system/recipes';
|
|
4
|
-
|
|
3
|
+
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
4
|
+
export declare const Input: StyledComponent<"input", InputVariantProps>;
|
|
5
5
|
export type InputProps = ComponentProps<typeof Input>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","names":[],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import type { ComponentProps, WheelEvent } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { input } from '@stokelp/styled-system/recipes'\n\nexport const Input = styled('input', input, {\n defaultProps: {\n onWheel: (event: WheelEvent<HTMLInputElement>) => {\n if (event.currentTarget.type === 'number') {\n event.currentTarget.blur()\n }\n },\n },\n dataAttr: true,\n})
|
|
1
|
+
{"version":3,"file":"Input.js","names":[],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import type { ComponentProps, WheelEvent } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { input, type InputVariantProps } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\n\n// See FormControl.tsx for why we pin the literal tag with an `as` cast.\n// Without this, `Input` becomes `StyledComponent<string, …>` and loses every\n// native HTML input attribute (type, placeholder, value, ref, etc.) in the\n// emitted d.ts.\nexport const Input = styled('input', input, {\n defaultProps: {\n onWheel: (event: WheelEvent<HTMLInputElement>) => {\n if (event.currentTarget.type === 'number') {\n event.currentTarget.blur()\n }\n },\n },\n dataAttr: true,\n}) as StyledComponent<'input', InputVariantProps>\n\nexport type InputProps = ComponentProps<typeof Input>\n"],"mappings":";;;;AAUA,IAAa,IAAQ,EAAO,SAAS,GAAO;CAC1C,cAAc,EACZ,UAAU,MAAwC;EAChD,AAAI,EAAM,cAAc,SAAS,YAC/B,EAAM,cAAc,KAAK;CAE7B,EACF;CACA,UAAU;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.cjs","names":[],"sources":["../../../src/components/input/InputGroup.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { inputGroup } from '@stokelp/styled-system/recipes'\n\nexport const InputGroup = styled('div', inputGroup, {\n dataAttr: true,\n})
|
|
1
|
+
{"version":3,"file":"InputGroup.cjs","names":[],"sources":["../../../src/components/input/InputGroup.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { inputGroup, type InputGroupVariantProps } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\n\n// See FormControl.tsx for why we pin the literal tag with an `as` cast.\nexport const InputGroup = styled('div', inputGroup, {\n dataAttr: true,\n}) as StyledComponent<'div', InputGroupVariantProps>\n\nexport interface InputGroupProps extends ComponentProps<typeof InputGroup> {}\n"],"mappings":"qGAOA,IAAa,GAAA,EAAA,EAAA,QAAoB,MAAO,EAAA,WAAY,CAClD,SAAU,EACZ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
3
2
|
import { InputGroupVariantProps } from '@stokelp/styled-system/recipes';
|
|
4
|
-
|
|
3
|
+
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
4
|
+
export declare const InputGroup: StyledComponent<"div", InputGroupVariantProps>;
|
|
5
5
|
export interface InputGroupProps extends ComponentProps<typeof InputGroup> {
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.js","names":[],"sources":["../../../src/components/input/InputGroup.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { inputGroup } from '@stokelp/styled-system/recipes'\n\nexport const InputGroup = styled('div', inputGroup, {\n dataAttr: true,\n})
|
|
1
|
+
{"version":3,"file":"InputGroup.js","names":[],"sources":["../../../src/components/input/InputGroup.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { inputGroup, type InputGroupVariantProps } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\n\n// See FormControl.tsx for why we pin the literal tag with an `as` cast.\nexport const InputGroup = styled('div', inputGroup, {\n dataAttr: true,\n}) as StyledComponent<'div', InputGroupVariantProps>\n\nexport interface InputGroupProps extends ComponentProps<typeof InputGroup> {}\n"],"mappings":";;;;AAOA,IAAa,IAAa,EAAO,OAAO,GAAY,EAClD,UAAU,GACZ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../utils/slots.cjs"),t=require("./TableProvider.cjs");let n=require("@stokelp/styled-system/jsx"),r=require("@stokelp/styled-system/recipes"),i=require("react"),a=require("react/jsx-runtime");var{withProvider:o,withContext:s}=e.createStyleContext(r.table),c=(0,n.styled)(
|
|
1
|
+
"use client";const e=require("../../utils/slots.cjs"),t=require("./TableProvider.cjs");let n=require("@stokelp/styled-system/jsx"),r=require("@stokelp/styled-system/recipes"),i=require("react"),a=require("react/jsx-runtime");var{withProvider:o,withContext:s}=e.createStyleContext(r.table),c=e=>(0,n.styled)(e),l=(0,n.styled)(`div`,r.tableContainer),u=o(c(`table`),`root`),d=(0,i.forwardRef)(({children:e,onSortChange:n,descriptor:r,...i},o)=>(0,a.jsx)(t.TableProvider,{descriptor:r,onSortChange:n,children:(0,a.jsx)(u,{ref:o,...i,children:e})}));d.displayName=`Table`;var f=s(c(`thead`),`thead`),p=s(c(`div`),`sortIndicatorRoot`),m=s(c(`svg`),`sortIndicator`),h=s(c(`tbody`),`tbody`),g=s(c(`tr`),`tr`),_=s(c(`th`),`th`),v=(0,i.forwardRef)(({children:e,addon:n,sortKey:r,onClick:i,...o},s)=>{let{dispatch:c,sortDescriptor:l}=t.useTable(),u=e=>{r&&(l===null?c({type:`UPDATE_SORT_DESCRIPTOR`,payload:{key:r,direction:`asc`}}):l.key===r?l.direction===`asc`?c({type:`UPDATE_SORT_DESCRIPTOR`,payload:{key:r,direction:`desc`}}):c({type:`CLEAR_SORT_DESCRIPTOR`}):c({type:`UPDATE_SORT_DESCRIPTOR`,payload:{key:r,direction:`asc`}})),i?.(e)};return(0,a.jsxs)(_,{ref:s,...o,...r?{"data-sortable":!0}:{},role:`group`,onClick:u,children:[e,n?(0,a.jsxs)(`span`,{className:`th__addon`,children:[`\xA0`,n]}):null,l&&l.key===r?(0,a.jsxs)(p,{"data-state":`active`,children:[(0,a.jsx)(m,{"data-active":l.direction===`asc`?!0:void 0,viewBox:`0 0 8 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,a.jsx)(`path`,{d:`M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z`,fill:`currentColor`})}),(0,a.jsx)(m,{"data-active":l.direction===`desc`?!0:void 0,viewBox:`0 0 8 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,a.jsx)(`path`,{d:`M2.33333 3.16666L3.99999 4.83332L5.66666 3.16666H2.33333Z`,fill:`currentColor`})})]}):r?(0,a.jsxs)(p,{"data-state":`idle`,children:[(0,a.jsx)(m,{"data-active":!0,viewBox:`0 0 8 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,a.jsx)(`path`,{d:`M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z`,fill:`currentColor`})}),(0,a.jsx)(m,{"data-active":!0,viewBox:`0 0 8 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,a.jsx)(`path`,{d:`M2.33333 3.16666L3.99999 4.83332L5.66666 3.16666H2.33333Z`,fill:`currentColor`})})]}):null]})});v.displayName=`Th`;var y=s(c(`td`),`td`),b=(0,n.styled)(`td`,r.tableGroupTitle),x=(0,i.forwardRef)((e,t)=>{let n=(0,i.useRef)(null);return(0,i.useLayoutEffect)(()=>{if(n.current){let e=n.current?.closest(`table`)?.querySelector(`thead > tr`);e&&n.current.setAttribute(`colspan`,e.children.length.toString())}},[]),(0,a.jsx)(`tr`,{ref:t,className:`table_tr__group__title`,children:(0,a.jsx)(b,{ref:n,...e})})});x.displayName=`TableGroupTitle`;var S=(0,n.styled)(`td`,r.tableEmptyRow),C=(0,i.forwardRef)((e,t)=>{let n=(0,i.useRef)(null);return(0,i.useLayoutEffect)(()=>{if(n.current){let e=n.current?.closest(`table`)?.querySelector(`thead > tr`);e&&n.current.setAttribute(`colspan`,e.children.length.toString())}},[]),(0,a.jsx)(`tr`,{ref:t,className:`table_tr__empty`,children:(0,a.jsx)(S,{ref:n,...e})})});C.displayName=`TableEmptyRow`,exports.Table=d,exports.TableContainer=l,exports.TableEmptyRow=C,exports.TableGroupTitle=x,exports.Tbody=h,exports.Td=y,exports.Th=v,exports.Thead=f,exports.Tr=g;
|
|
2
2
|
//# sourceMappingURL=Table.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.cjs","names":[],"sources":["../../../src/components/table/Table.tsx"],"sourcesContent":["import type { ComponentProps, ElementRef, FC, MouseEvent, ReactNode } from 'react'\nimport { forwardRef, useLayoutEffect, useRef } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { table, tableContainer, tableEmptyRow, tableGroupTitle } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { TableProvider, type TableProviderProps, useTable } from './TableProvider'\n\nconst { withProvider, withContext } = createStyleContext(table)\n\nexport const TableContainer = styled('div', tableContainer)\n\nconst StyledTable = withProvider(styled('table'), 'root')\ntype StyledTableProps = ComponentProps<typeof StyledTable>\n\nexport type TableProps = StyledTableProps & Pick<TableProviderProps, 'onSortChange' | 'descriptor'>\n\nexport const Table = forwardRef<ElementRef<typeof StyledTable>, TableProps>(\n ({ children, onSortChange, descriptor, ...props }, ref) => {\n return (\n <TableProvider descriptor={descriptor} onSortChange={onSortChange}>\n <StyledTable ref={ref} {...props}>\n {children}\n </StyledTable>\n </TableProvider>\n )\n },\n) as FC<TableProps>\n\nTable.displayName = 'Table'\n\nexport const Thead = withContext(styled('thead'), 'thead')\nconst SortIndicatorRoot = withContext(styled('div'), 'sortIndicatorRoot')\nconst SortIndicator = withContext(styled('svg'), 'sortIndicator')\nexport const Tbody = withContext(styled('tbody'), 'tbody')\nexport const Tr = withContext(styled('tr'), 'tr')\nconst StyledTh = withContext(styled('th'), 'th')\n\ntype StyledThProps = ComponentProps<typeof StyledTh>\n\nexport type ThProps = StyledThProps & {\n addon?: ReactNode\n sortKey?: string\n}\n\nexport const Th = forwardRef<ElementRef<typeof StyledTh>, ThProps>(\n ({ children, addon, sortKey, onClick, ...props }, ref) => {\n const { dispatch, sortDescriptor } = useTable()\n\n const handleOnClick = (e: MouseEvent<HTMLTableCellElement>) => {\n if (sortKey) {\n if (sortDescriptor === null) {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'asc',\n },\n })\n } else if (sortDescriptor.key === sortKey) {\n if (sortDescriptor.direction === 'asc') {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'desc',\n },\n })\n } else {\n dispatch({\n type: 'CLEAR_SORT_DESCRIPTOR',\n })\n }\n } else {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'asc',\n },\n })\n }\n }\n onClick?.(e)\n }\n\n return (\n <StyledTh\n ref={ref}\n {...props}\n {...(sortKey ? { 'data-sortable': true } : {})}\n role=\"group\"\n onClick={handleOnClick}\n >\n {children}\n {addon ? <span className=\"th__addon\"> {addon}</span> : null}\n {sortDescriptor && sortDescriptor.key === sortKey ? (\n <SortIndicatorRoot data-state=\"active\">\n <SortIndicator\n data-active={sortDescriptor.direction === 'asc' ? true : undefined}\n viewBox=\"0 0 8 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z\" fill=\"currentColor\" />\n </SortIndicator>\n <SortIndicator\n data-active={sortDescriptor.direction === 'desc' ? true : undefined}\n viewBox=\"0 0 8 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.33333 3.16666L3.99999 4.83332L5.66666 3.16666H2.33333Z\" fill=\"currentColor\" />\n </SortIndicator>\n </SortIndicatorRoot>\n ) : sortKey ? (\n <SortIndicatorRoot data-state=\"idle\">\n <SortIndicator data-active={true} viewBox=\"0 0 8 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z\" fill=\"currentColor\" />\n </SortIndicator>\n <SortIndicator data-active={true} viewBox=\"0 0 8 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.33333 3.16666L3.99999 4.83332L5.66666 3.16666H2.33333Z\" fill=\"currentColor\" />\n </SortIndicator>\n </SortIndicatorRoot>\n ) : null}\n </StyledTh>\n )\n },\n) as FC<ThProps>\n\nTh.displayName = 'Th'\n\nexport const Td = withContext(styled('td'), 'td')\n\nconst StyledTableGroupTitle = styled('td', tableGroupTitle)\nexport type TableGroupTitleProps = ComponentProps<typeof StyledTableGroupTitle>\nexport const TableGroupTitle = forwardRef<HTMLTableRowElement, TableGroupTitleProps>((props, ref) => {\n const $td = useRef<ElementRef<typeof StyledTableGroupTitle>>(null)\n useLayoutEffect(() => {\n if ($td.current) {\n const tableColumns = $td.current?.closest('table')?.querySelector('thead > tr')\n if (tableColumns) {\n $td.current.setAttribute('colspan', tableColumns.children.length.toString())\n }\n }\n }, [])\n\n return (\n <tr ref={ref} className=\"table_tr__group__title\">\n <StyledTableGroupTitle ref={$td} {...props} />\n </tr>\n )\n}) as FC<TableGroupTitleProps>\nTableGroupTitle.displayName = 'TableGroupTitle'\n\nconst StyledTableEmptyRow = styled('td', tableEmptyRow)\nexport type TableEmptyRowProps = ComponentProps<typeof StyledTableEmptyRow>\nexport const TableEmptyRow = forwardRef<HTMLTableRowElement, TableEmptyRowProps>((props, ref) => {\n const $td = useRef<ElementRef<typeof StyledTableEmptyRow>>(null)\n useLayoutEffect(() => {\n if ($td.current) {\n const tableColumns = $td.current?.closest('table')?.querySelector('thead > tr')\n if (tableColumns) {\n $td.current.setAttribute('colspan', tableColumns.children.length.toString())\n }\n }\n }, [])\n\n return (\n <tr ref={ref} className=\"table_tr__empty\">\n <StyledTableEmptyRow ref={$td} {...props} />\n </tr>\n )\n}) as FC<TableEmptyRowProps>\nTableEmptyRow.displayName = 'TableEmptyRow'\n\nexport interface TheadProps extends ComponentProps<typeof Thead> {}\n\nexport interface TbodyProps extends ComponentProps<typeof Tbody> {}\n\nexport interface TrProps extends ComponentProps<typeof Tr> {}\n\nexport interface TdProps extends ComponentProps<typeof Td> {}\n\nexport interface TableContainerProps extends ComponentProps<typeof TableContainer> {}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Table.cjs","names":[],"sources":["../../../src/components/table/Table.tsx"],"sourcesContent":["import type { ComponentProps, ElementRef, FC, JSX, MouseEvent, ReactNode } from 'react'\nimport { forwardRef, useLayoutEffect, useRef } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport {\n table,\n tableContainer,\n tableEmptyRow,\n tableGroupTitle,\n type TableContainerVariantProps,\n type TableEmptyRowVariantProps,\n type TableGroupTitleVariantProps,\n} from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { createStyleContext } from '~/utils/slots'\nimport { TableProvider, type TableProviderProps, useTable } from './TableProvider'\n\nconst { withProvider, withContext } = createStyleContext(table)\n\n// Helper: `styled('tag')` returns `StyledComponent<T, {}>` but TS widens the\n// literal to `string` at d.ts emit, stripping every native HTML attribute\n// from consumer typings. This wrapper pins the literal tag via the generic.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nexport const TableContainer = styled('div', tableContainer) as StyledComponent<'div', TableContainerVariantProps>\n\nconst StyledTable = withProvider(styledTag('table'), 'root')\ntype StyledTableProps = ComponentProps<typeof StyledTable>\n\nexport type TableProps = StyledTableProps & Pick<TableProviderProps, 'onSortChange' | 'descriptor'>\n\nexport const Table = forwardRef<ElementRef<typeof StyledTable>, TableProps>(\n ({ children, onSortChange, descriptor, ...props }, ref) => {\n return (\n <TableProvider descriptor={descriptor} onSortChange={onSortChange}>\n <StyledTable ref={ref} {...props}>\n {children}\n </StyledTable>\n </TableProvider>\n )\n },\n) as FC<TableProps>\n\nTable.displayName = 'Table'\n\nexport const Thead = withContext(styledTag('thead'), 'thead')\nconst SortIndicatorRoot = withContext(styledTag('div'), 'sortIndicatorRoot')\nconst SortIndicator = withContext(styledTag('svg'), 'sortIndicator')\nexport const Tbody = withContext(styledTag('tbody'), 'tbody')\nexport const Tr = withContext(styledTag('tr'), 'tr')\nconst StyledTh = withContext(styledTag('th'), 'th')\n\ntype StyledThProps = ComponentProps<typeof StyledTh>\n\nexport type ThProps = StyledThProps & {\n addon?: ReactNode\n sortKey?: string\n}\n\nexport const Th = forwardRef<ElementRef<typeof StyledTh>, ThProps>(\n ({ children, addon, sortKey, onClick, ...props }, ref) => {\n const { dispatch, sortDescriptor } = useTable()\n\n const handleOnClick = (e: MouseEvent<HTMLTableCellElement>) => {\n if (sortKey) {\n if (sortDescriptor === null) {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'asc',\n },\n })\n } else if (sortDescriptor.key === sortKey) {\n if (sortDescriptor.direction === 'asc') {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'desc',\n },\n })\n } else {\n dispatch({\n type: 'CLEAR_SORT_DESCRIPTOR',\n })\n }\n } else {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'asc',\n },\n })\n }\n }\n onClick?.(e)\n }\n\n return (\n <StyledTh\n ref={ref}\n {...props}\n {...(sortKey ? { 'data-sortable': true } : {})}\n role=\"group\"\n onClick={handleOnClick}\n >\n {children}\n {addon ? <span className=\"th__addon\"> {addon}</span> : null}\n {sortDescriptor && sortDescriptor.key === sortKey ? (\n <SortIndicatorRoot data-state=\"active\">\n <SortIndicator\n data-active={sortDescriptor.direction === 'asc' ? true : undefined}\n viewBox=\"0 0 8 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z\" fill=\"currentColor\" />\n </SortIndicator>\n <SortIndicator\n data-active={sortDescriptor.direction === 'desc' ? true : undefined}\n viewBox=\"0 0 8 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.33333 3.16666L3.99999 4.83332L5.66666 3.16666H2.33333Z\" fill=\"currentColor\" />\n </SortIndicator>\n </SortIndicatorRoot>\n ) : sortKey ? (\n <SortIndicatorRoot data-state=\"idle\">\n <SortIndicator data-active={true} viewBox=\"0 0 8 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z\" fill=\"currentColor\" />\n </SortIndicator>\n <SortIndicator data-active={true} viewBox=\"0 0 8 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.33333 3.16666L3.99999 4.83332L5.66666 3.16666H2.33333Z\" fill=\"currentColor\" />\n </SortIndicator>\n </SortIndicatorRoot>\n ) : null}\n </StyledTh>\n )\n },\n) as FC<ThProps>\n\nTh.displayName = 'Th'\n\nexport const Td = withContext(styledTag('td'), 'td')\n\nconst StyledTableGroupTitle = styled('td', tableGroupTitle) as StyledComponent<'td', TableGroupTitleVariantProps>\nexport type TableGroupTitleProps = ComponentProps<typeof StyledTableGroupTitle>\nexport const TableGroupTitle = forwardRef<HTMLTableRowElement, TableGroupTitleProps>((props, ref) => {\n const $td = useRef<ElementRef<typeof StyledTableGroupTitle>>(null)\n useLayoutEffect(() => {\n if ($td.current) {\n const tableColumns = $td.current?.closest('table')?.querySelector('thead > tr')\n if (tableColumns) {\n $td.current.setAttribute('colspan', tableColumns.children.length.toString())\n }\n }\n }, [])\n\n return (\n <tr ref={ref} className=\"table_tr__group__title\">\n <StyledTableGroupTitle ref={$td} {...props} />\n </tr>\n )\n}) as FC<TableGroupTitleProps>\nTableGroupTitle.displayName = 'TableGroupTitle'\n\nconst StyledTableEmptyRow = styled('td', tableEmptyRow) as StyledComponent<'td', TableEmptyRowVariantProps>\nexport type TableEmptyRowProps = ComponentProps<typeof StyledTableEmptyRow>\nexport const TableEmptyRow = forwardRef<HTMLTableRowElement, TableEmptyRowProps>((props, ref) => {\n const $td = useRef<ElementRef<typeof StyledTableEmptyRow>>(null)\n useLayoutEffect(() => {\n if ($td.current) {\n const tableColumns = $td.current?.closest('table')?.querySelector('thead > tr')\n if (tableColumns) {\n $td.current.setAttribute('colspan', tableColumns.children.length.toString())\n }\n }\n }, [])\n\n return (\n <tr ref={ref} className=\"table_tr__empty\">\n <StyledTableEmptyRow ref={$td} {...props} />\n </tr>\n )\n}) as FC<TableEmptyRowProps>\nTableEmptyRow.displayName = 'TableEmptyRow'\n\nexport interface TheadProps extends ComponentProps<typeof Thead> {}\n\nexport interface TbodyProps extends ComponentProps<typeof Tbody> {}\n\nexport interface TrProps extends ComponentProps<typeof Tr> {}\n\nexport interface TdProps extends ComponentProps<typeof Td> {}\n\nexport interface TableContainerProps extends ComponentProps<typeof TableContainer> {}\n"],"mappings":"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"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { ComponentProps, FC, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TableContainerVariantProps, TableEmptyRowVariantProps, TableGroupTitleVariantProps, TableRecipe } from '@stokelp/styled-system/recipes';
|
|
3
3
|
import { StyledComponent } from '@stokelp/styled-system/types';
|
|
4
|
-
import {
|
|
4
|
+
import { TableProviderProps } from './TableProvider';
|
|
5
5
|
import { ComponentVariants } from '../../utils/slots';
|
|
6
|
-
export declare const TableContainer: StyledComponent<
|
|
7
|
-
declare const StyledTable: ComponentVariants<StyledComponent<
|
|
6
|
+
export declare const TableContainer: StyledComponent<"div", TableContainerVariantProps>;
|
|
7
|
+
declare const StyledTable: ComponentVariants<StyledComponent<"table", {}>, TableRecipe>;
|
|
8
8
|
type StyledTableProps = ComponentProps<typeof StyledTable>;
|
|
9
9
|
export type TableProps = StyledTableProps & Pick<TableProviderProps, 'onSortChange' | 'descriptor'>;
|
|
10
10
|
export declare const Table: FC<TableProps>;
|
|
11
|
-
export declare const Thead: StyledComponent<
|
|
12
|
-
export declare const Tbody: StyledComponent<
|
|
13
|
-
export declare const Tr: StyledComponent<
|
|
14
|
-
declare const StyledTh: StyledComponent<
|
|
11
|
+
export declare const Thead: StyledComponent<"thead", {}>;
|
|
12
|
+
export declare const Tbody: StyledComponent<"tbody", {}>;
|
|
13
|
+
export declare const Tr: StyledComponent<"tr", {}>;
|
|
14
|
+
declare const StyledTh: StyledComponent<"th", {}>;
|
|
15
15
|
type StyledThProps = ComponentProps<typeof StyledTh>;
|
|
16
16
|
export type ThProps = StyledThProps & {
|
|
17
17
|
addon?: ReactNode;
|
|
18
18
|
sortKey?: string;
|
|
19
19
|
};
|
|
20
20
|
export declare const Th: FC<ThProps>;
|
|
21
|
-
export declare const Td: StyledComponent<
|
|
22
|
-
declare const StyledTableGroupTitle: StyledComponent<
|
|
21
|
+
export declare const Td: StyledComponent<"td", {}>;
|
|
22
|
+
declare const StyledTableGroupTitle: StyledComponent<"td", TableGroupTitleVariantProps>;
|
|
23
23
|
export type TableGroupTitleProps = ComponentProps<typeof StyledTableGroupTitle>;
|
|
24
24
|
export declare const TableGroupTitle: FC<TableGroupTitleProps>;
|
|
25
|
-
declare const StyledTableEmptyRow: StyledComponent<
|
|
25
|
+
declare const StyledTableEmptyRow: StyledComponent<"td", TableEmptyRowVariantProps>;
|
|
26
26
|
export type TableEmptyRowProps = ComponentProps<typeof StyledTableEmptyRow>;
|
|
27
27
|
export declare const TableEmptyRow: FC<TableEmptyRowProps>;
|
|
28
28
|
export interface TheadProps extends ComponentProps<typeof Thead> {
|
|
@@ -6,17 +6,17 @@ import { table as i, tableContainer as a, tableEmptyRow as o, tableGroupTitle as
|
|
|
6
6
|
import { forwardRef as c, useLayoutEffect as l, useRef as u } from "react";
|
|
7
7
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/table/Table.tsx
|
|
9
|
-
var { withProvider: p, withContext: m } = e(i), h = r("div", a),
|
|
9
|
+
var { withProvider: p, withContext: m } = e(i), h = (e) => r(e), g = r("div", a), _ = p(h("table"), "root"), v = c(({ children: e, onSortChange: n, descriptor: r, ...i }, a) => /* @__PURE__ */ d(t, {
|
|
10
10
|
descriptor: r,
|
|
11
11
|
onSortChange: n,
|
|
12
|
-
children: /* @__PURE__ */ d(
|
|
12
|
+
children: /* @__PURE__ */ d(_, {
|
|
13
13
|
ref: a,
|
|
14
14
|
...i,
|
|
15
15
|
children: e
|
|
16
16
|
})
|
|
17
17
|
}));
|
|
18
|
-
|
|
19
|
-
var
|
|
18
|
+
v.displayName = "Table";
|
|
19
|
+
var y = m(h("thead"), "thead"), b = m(h("div"), "sortIndicatorRoot"), x = m(h("svg"), "sortIndicator"), S = m(h("tbody"), "tbody"), C = m(h("tr"), "tr"), w = m(h("th"), "th"), T = c(({ children: e, addon: t, sortKey: r, onClick: i, ...a }, o) => {
|
|
20
20
|
let { dispatch: s, sortDescriptor: c } = n(), l = (e) => {
|
|
21
21
|
r && (c === null ? s({
|
|
22
22
|
type: "UPDATE_SORT_DESCRIPTOR",
|
|
@@ -38,7 +38,7 @@ var v = m(r("thead"), "thead"), y = m(r("div"), "sortIndicatorRoot"), b = m(r("s
|
|
|
38
38
|
}
|
|
39
39
|
})), i?.(e);
|
|
40
40
|
};
|
|
41
|
-
return /* @__PURE__ */ f(
|
|
41
|
+
return /* @__PURE__ */ f(w, {
|
|
42
42
|
ref: o,
|
|
43
43
|
...a,
|
|
44
44
|
...r ? { "data-sortable": !0 } : {},
|
|
@@ -50,9 +50,9 @@ var v = m(r("thead"), "thead"), y = m(r("div"), "sortIndicatorRoot"), b = m(r("s
|
|
|
50
50
|
className: "th__addon",
|
|
51
51
|
children: ["\xA0", t]
|
|
52
52
|
}) : null,
|
|
53
|
-
c && c.key === r ? /* @__PURE__ */ f(
|
|
53
|
+
c && c.key === r ? /* @__PURE__ */ f(b, {
|
|
54
54
|
"data-state": "active",
|
|
55
|
-
children: [/* @__PURE__ */ d(
|
|
55
|
+
children: [/* @__PURE__ */ d(x, {
|
|
56
56
|
"data-active": c.direction === "asc" ? !0 : void 0,
|
|
57
57
|
viewBox: "0 0 8 8",
|
|
58
58
|
fill: "none",
|
|
@@ -61,7 +61,7 @@ var v = m(r("thead"), "thead"), y = m(r("div"), "sortIndicatorRoot"), b = m(r("s
|
|
|
61
61
|
d: "M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z",
|
|
62
62
|
fill: "currentColor"
|
|
63
63
|
})
|
|
64
|
-
}), /* @__PURE__ */ d(
|
|
64
|
+
}), /* @__PURE__ */ d(x, {
|
|
65
65
|
"data-active": c.direction === "desc" ? !0 : void 0,
|
|
66
66
|
viewBox: "0 0 8 8",
|
|
67
67
|
fill: "none",
|
|
@@ -71,9 +71,9 @@ var v = m(r("thead"), "thead"), y = m(r("div"), "sortIndicatorRoot"), b = m(r("s
|
|
|
71
71
|
fill: "currentColor"
|
|
72
72
|
})
|
|
73
73
|
})]
|
|
74
|
-
}) : r ? /* @__PURE__ */ f(
|
|
74
|
+
}) : r ? /* @__PURE__ */ f(b, {
|
|
75
75
|
"data-state": "idle",
|
|
76
|
-
children: [/* @__PURE__ */ d(
|
|
76
|
+
children: [/* @__PURE__ */ d(x, {
|
|
77
77
|
"data-active": !0,
|
|
78
78
|
viewBox: "0 0 8 8",
|
|
79
79
|
fill: "none",
|
|
@@ -82,7 +82,7 @@ var v = m(r("thead"), "thead"), y = m(r("div"), "sortIndicatorRoot"), b = m(r("s
|
|
|
82
82
|
d: "M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z",
|
|
83
83
|
fill: "currentColor"
|
|
84
84
|
})
|
|
85
|
-
}), /* @__PURE__ */ d(
|
|
85
|
+
}), /* @__PURE__ */ d(x, {
|
|
86
86
|
"data-active": !0,
|
|
87
87
|
viewBox: "0 0 8 8",
|
|
88
88
|
fill: "none",
|
|
@@ -96,8 +96,8 @@ var v = m(r("thead"), "thead"), y = m(r("div"), "sortIndicatorRoot"), b = m(r("s
|
|
|
96
96
|
]
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
|
-
|
|
100
|
-
var
|
|
99
|
+
T.displayName = "Th";
|
|
100
|
+
var E = m(h("td"), "td"), D = r("td", s), O = c((e, t) => {
|
|
101
101
|
let n = u(null);
|
|
102
102
|
return l(() => {
|
|
103
103
|
if (n.current) {
|
|
@@ -107,14 +107,14 @@ var T = m(r("td"), "td"), E = r("td", s), D = c((e, t) => {
|
|
|
107
107
|
}, []), /* @__PURE__ */ d("tr", {
|
|
108
108
|
ref: t,
|
|
109
109
|
className: "table_tr__group__title",
|
|
110
|
-
children: /* @__PURE__ */ d(
|
|
110
|
+
children: /* @__PURE__ */ d(D, {
|
|
111
111
|
ref: n,
|
|
112
112
|
...e
|
|
113
113
|
})
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
|
-
|
|
117
|
-
var
|
|
116
|
+
O.displayName = "TableGroupTitle";
|
|
117
|
+
var k = r("td", o), A = c((e, t) => {
|
|
118
118
|
let n = u(null);
|
|
119
119
|
return l(() => {
|
|
120
120
|
if (n.current) {
|
|
@@ -124,14 +124,14 @@ var O = r("td", o), k = c((e, t) => {
|
|
|
124
124
|
}, []), /* @__PURE__ */ d("tr", {
|
|
125
125
|
ref: t,
|
|
126
126
|
className: "table_tr__empty",
|
|
127
|
-
children: /* @__PURE__ */ d(
|
|
127
|
+
children: /* @__PURE__ */ d(k, {
|
|
128
128
|
ref: n,
|
|
129
129
|
...e
|
|
130
130
|
})
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
|
-
|
|
133
|
+
A.displayName = "TableEmptyRow";
|
|
134
134
|
//#endregion
|
|
135
|
-
export {
|
|
135
|
+
export { v as Table, g as TableContainer, A as TableEmptyRow, O as TableGroupTitle, S as Tbody, E as Td, T as Th, y as Thead, C as Tr };
|
|
136
136
|
|
|
137
137
|
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","names":[],"sources":["../../../src/components/table/Table.tsx"],"sourcesContent":["import type { ComponentProps, ElementRef, FC, MouseEvent, ReactNode } from 'react'\nimport { forwardRef, useLayoutEffect, useRef } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { table, tableContainer, tableEmptyRow, tableGroupTitle } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { TableProvider, type TableProviderProps, useTable } from './TableProvider'\n\nconst { withProvider, withContext } = createStyleContext(table)\n\nexport const TableContainer = styled('div', tableContainer)\n\nconst StyledTable = withProvider(styled('table'), 'root')\ntype StyledTableProps = ComponentProps<typeof StyledTable>\n\nexport type TableProps = StyledTableProps & Pick<TableProviderProps, 'onSortChange' | 'descriptor'>\n\nexport const Table = forwardRef<ElementRef<typeof StyledTable>, TableProps>(\n ({ children, onSortChange, descriptor, ...props }, ref) => {\n return (\n <TableProvider descriptor={descriptor} onSortChange={onSortChange}>\n <StyledTable ref={ref} {...props}>\n {children}\n </StyledTable>\n </TableProvider>\n )\n },\n) as FC<TableProps>\n\nTable.displayName = 'Table'\n\nexport const Thead = withContext(styled('thead'), 'thead')\nconst SortIndicatorRoot = withContext(styled('div'), 'sortIndicatorRoot')\nconst SortIndicator = withContext(styled('svg'), 'sortIndicator')\nexport const Tbody = withContext(styled('tbody'), 'tbody')\nexport const Tr = withContext(styled('tr'), 'tr')\nconst StyledTh = withContext(styled('th'), 'th')\n\ntype StyledThProps = ComponentProps<typeof StyledTh>\n\nexport type ThProps = StyledThProps & {\n addon?: ReactNode\n sortKey?: string\n}\n\nexport const Th = forwardRef<ElementRef<typeof StyledTh>, ThProps>(\n ({ children, addon, sortKey, onClick, ...props }, ref) => {\n const { dispatch, sortDescriptor } = useTable()\n\n const handleOnClick = (e: MouseEvent<HTMLTableCellElement>) => {\n if (sortKey) {\n if (sortDescriptor === null) {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'asc',\n },\n })\n } else if (sortDescriptor.key === sortKey) {\n if (sortDescriptor.direction === 'asc') {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'desc',\n },\n })\n } else {\n dispatch({\n type: 'CLEAR_SORT_DESCRIPTOR',\n })\n }\n } else {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'asc',\n },\n })\n }\n }\n onClick?.(e)\n }\n\n return (\n <StyledTh\n ref={ref}\n {...props}\n {...(sortKey ? { 'data-sortable': true } : {})}\n role=\"group\"\n onClick={handleOnClick}\n >\n {children}\n {addon ? <span className=\"th__addon\"> {addon}</span> : null}\n {sortDescriptor && sortDescriptor.key === sortKey ? (\n <SortIndicatorRoot data-state=\"active\">\n <SortIndicator\n data-active={sortDescriptor.direction === 'asc' ? true : undefined}\n viewBox=\"0 0 8 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z\" fill=\"currentColor\" />\n </SortIndicator>\n <SortIndicator\n data-active={sortDescriptor.direction === 'desc' ? true : undefined}\n viewBox=\"0 0 8 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.33333 3.16666L3.99999 4.83332L5.66666 3.16666H2.33333Z\" fill=\"currentColor\" />\n </SortIndicator>\n </SortIndicatorRoot>\n ) : sortKey ? (\n <SortIndicatorRoot data-state=\"idle\">\n <SortIndicator data-active={true} viewBox=\"0 0 8 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z\" fill=\"currentColor\" />\n </SortIndicator>\n <SortIndicator data-active={true} viewBox=\"0 0 8 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.33333 3.16666L3.99999 4.83332L5.66666 3.16666H2.33333Z\" fill=\"currentColor\" />\n </SortIndicator>\n </SortIndicatorRoot>\n ) : null}\n </StyledTh>\n )\n },\n) as FC<ThProps>\n\nTh.displayName = 'Th'\n\nexport const Td = withContext(styled('td'), 'td')\n\nconst StyledTableGroupTitle = styled('td', tableGroupTitle)\nexport type TableGroupTitleProps = ComponentProps<typeof StyledTableGroupTitle>\nexport const TableGroupTitle = forwardRef<HTMLTableRowElement, TableGroupTitleProps>((props, ref) => {\n const $td = useRef<ElementRef<typeof StyledTableGroupTitle>>(null)\n useLayoutEffect(() => {\n if ($td.current) {\n const tableColumns = $td.current?.closest('table')?.querySelector('thead > tr')\n if (tableColumns) {\n $td.current.setAttribute('colspan', tableColumns.children.length.toString())\n }\n }\n }, [])\n\n return (\n <tr ref={ref} className=\"table_tr__group__title\">\n <StyledTableGroupTitle ref={$td} {...props} />\n </tr>\n )\n}) as FC<TableGroupTitleProps>\nTableGroupTitle.displayName = 'TableGroupTitle'\n\nconst StyledTableEmptyRow = styled('td', tableEmptyRow)\nexport type TableEmptyRowProps = ComponentProps<typeof StyledTableEmptyRow>\nexport const TableEmptyRow = forwardRef<HTMLTableRowElement, TableEmptyRowProps>((props, ref) => {\n const $td = useRef<ElementRef<typeof StyledTableEmptyRow>>(null)\n useLayoutEffect(() => {\n if ($td.current) {\n const tableColumns = $td.current?.closest('table')?.querySelector('thead > tr')\n if (tableColumns) {\n $td.current.setAttribute('colspan', tableColumns.children.length.toString())\n }\n }\n }, [])\n\n return (\n <tr ref={ref} className=\"table_tr__empty\">\n <StyledTableEmptyRow ref={$td} {...props} />\n </tr>\n )\n}) as FC<TableEmptyRowProps>\nTableEmptyRow.displayName = 'TableEmptyRow'\n\nexport interface TheadProps extends ComponentProps<typeof Thead> {}\n\nexport interface TbodyProps extends ComponentProps<typeof Tbody> {}\n\nexport interface TrProps extends ComponentProps<typeof Tr> {}\n\nexport interface TdProps extends ComponentProps<typeof Td> {}\n\nexport interface TableContainerProps extends ComponentProps<typeof TableContainer> {}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Table.js","names":[],"sources":["../../../src/components/table/Table.tsx"],"sourcesContent":["import type { ComponentProps, ElementRef, FC, JSX, MouseEvent, ReactNode } from 'react'\nimport { forwardRef, useLayoutEffect, useRef } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport {\n table,\n tableContainer,\n tableEmptyRow,\n tableGroupTitle,\n type TableContainerVariantProps,\n type TableEmptyRowVariantProps,\n type TableGroupTitleVariantProps,\n} from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { createStyleContext } from '~/utils/slots'\nimport { TableProvider, type TableProviderProps, useTable } from './TableProvider'\n\nconst { withProvider, withContext } = createStyleContext(table)\n\n// Helper: `styled('tag')` returns `StyledComponent<T, {}>` but TS widens the\n// literal to `string` at d.ts emit, stripping every native HTML attribute\n// from consumer typings. This wrapper pins the literal tag via the generic.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nexport const TableContainer = styled('div', tableContainer) as StyledComponent<'div', TableContainerVariantProps>\n\nconst StyledTable = withProvider(styledTag('table'), 'root')\ntype StyledTableProps = ComponentProps<typeof StyledTable>\n\nexport type TableProps = StyledTableProps & Pick<TableProviderProps, 'onSortChange' | 'descriptor'>\n\nexport const Table = forwardRef<ElementRef<typeof StyledTable>, TableProps>(\n ({ children, onSortChange, descriptor, ...props }, ref) => {\n return (\n <TableProvider descriptor={descriptor} onSortChange={onSortChange}>\n <StyledTable ref={ref} {...props}>\n {children}\n </StyledTable>\n </TableProvider>\n )\n },\n) as FC<TableProps>\n\nTable.displayName = 'Table'\n\nexport const Thead = withContext(styledTag('thead'), 'thead')\nconst SortIndicatorRoot = withContext(styledTag('div'), 'sortIndicatorRoot')\nconst SortIndicator = withContext(styledTag('svg'), 'sortIndicator')\nexport const Tbody = withContext(styledTag('tbody'), 'tbody')\nexport const Tr = withContext(styledTag('tr'), 'tr')\nconst StyledTh = withContext(styledTag('th'), 'th')\n\ntype StyledThProps = ComponentProps<typeof StyledTh>\n\nexport type ThProps = StyledThProps & {\n addon?: ReactNode\n sortKey?: string\n}\n\nexport const Th = forwardRef<ElementRef<typeof StyledTh>, ThProps>(\n ({ children, addon, sortKey, onClick, ...props }, ref) => {\n const { dispatch, sortDescriptor } = useTable()\n\n const handleOnClick = (e: MouseEvent<HTMLTableCellElement>) => {\n if (sortKey) {\n if (sortDescriptor === null) {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'asc',\n },\n })\n } else if (sortDescriptor.key === sortKey) {\n if (sortDescriptor.direction === 'asc') {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'desc',\n },\n })\n } else {\n dispatch({\n type: 'CLEAR_SORT_DESCRIPTOR',\n })\n }\n } else {\n dispatch({\n type: 'UPDATE_SORT_DESCRIPTOR',\n payload: {\n key: sortKey,\n direction: 'asc',\n },\n })\n }\n }\n onClick?.(e)\n }\n\n return (\n <StyledTh\n ref={ref}\n {...props}\n {...(sortKey ? { 'data-sortable': true } : {})}\n role=\"group\"\n onClick={handleOnClick}\n >\n {children}\n {addon ? <span className=\"th__addon\"> {addon}</span> : null}\n {sortDescriptor && sortDescriptor.key === sortKey ? (\n <SortIndicatorRoot data-state=\"active\">\n <SortIndicator\n data-active={sortDescriptor.direction === 'asc' ? true : undefined}\n viewBox=\"0 0 8 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z\" fill=\"currentColor\" />\n </SortIndicator>\n <SortIndicator\n data-active={sortDescriptor.direction === 'desc' ? true : undefined}\n viewBox=\"0 0 8 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M2.33333 3.16666L3.99999 4.83332L5.66666 3.16666H2.33333Z\" fill=\"currentColor\" />\n </SortIndicator>\n </SortIndicatorRoot>\n ) : sortKey ? (\n <SortIndicatorRoot data-state=\"idle\">\n <SortIndicator data-active={true} viewBox=\"0 0 8 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.33334 4.83332L4.00001 3.16666L5.66668 4.83332H2.33334Z\" fill=\"currentColor\" />\n </SortIndicator>\n <SortIndicator data-active={true} viewBox=\"0 0 8 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.33333 3.16666L3.99999 4.83332L5.66666 3.16666H2.33333Z\" fill=\"currentColor\" />\n </SortIndicator>\n </SortIndicatorRoot>\n ) : null}\n </StyledTh>\n )\n },\n) as FC<ThProps>\n\nTh.displayName = 'Th'\n\nexport const Td = withContext(styledTag('td'), 'td')\n\nconst StyledTableGroupTitle = styled('td', tableGroupTitle) as StyledComponent<'td', TableGroupTitleVariantProps>\nexport type TableGroupTitleProps = ComponentProps<typeof StyledTableGroupTitle>\nexport const TableGroupTitle = forwardRef<HTMLTableRowElement, TableGroupTitleProps>((props, ref) => {\n const $td = useRef<ElementRef<typeof StyledTableGroupTitle>>(null)\n useLayoutEffect(() => {\n if ($td.current) {\n const tableColumns = $td.current?.closest('table')?.querySelector('thead > tr')\n if (tableColumns) {\n $td.current.setAttribute('colspan', tableColumns.children.length.toString())\n }\n }\n }, [])\n\n return (\n <tr ref={ref} className=\"table_tr__group__title\">\n <StyledTableGroupTitle ref={$td} {...props} />\n </tr>\n )\n}) as FC<TableGroupTitleProps>\nTableGroupTitle.displayName = 'TableGroupTitle'\n\nconst StyledTableEmptyRow = styled('td', tableEmptyRow) as StyledComponent<'td', TableEmptyRowVariantProps>\nexport type TableEmptyRowProps = ComponentProps<typeof StyledTableEmptyRow>\nexport const TableEmptyRow = forwardRef<HTMLTableRowElement, TableEmptyRowProps>((props, ref) => {\n const $td = useRef<ElementRef<typeof StyledTableEmptyRow>>(null)\n useLayoutEffect(() => {\n if ($td.current) {\n const tableColumns = $td.current?.closest('table')?.querySelector('thead > tr')\n if (tableColumns) {\n $td.current.setAttribute('colspan', tableColumns.children.length.toString())\n }\n }\n }, [])\n\n return (\n <tr ref={ref} className=\"table_tr__empty\">\n <StyledTableEmptyRow ref={$td} {...props} />\n </tr>\n )\n}) as FC<TableEmptyRowProps>\nTableEmptyRow.displayName = 'TableEmptyRow'\n\nexport interface TheadProps extends ComponentProps<typeof Thead> {}\n\nexport interface TbodyProps extends ComponentProps<typeof Tbody> {}\n\nexport interface TrProps extends ComponentProps<typeof Tr> {}\n\nexport interface TdProps extends ComponentProps<typeof Td> {}\n\nexport interface TableContainerProps extends ComponentProps<typeof TableContainer> {}\n"],"mappings":"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"}
|