@oztix/roadie-components 1.0.0 → 1.1.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/Button.js CHANGED
@@ -1,3 +1,2 @@
1
- export { a as Button } from './_chunks/chunk-VDMZIGT2.js';
2
- //# sourceMappingURL=out.js.map
1
+ export{a as Button}from'./_chunks/chunk-VDMZIGT2.js';//# sourceMappingURL=Button.js.map
3
2
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"Button.js"}
package/dist/Code.js CHANGED
@@ -1,3 +1,2 @@
1
- export { a as Code } from './_chunks/chunk-P5L5LN6E.js';
2
- //# sourceMappingURL=out.js.map
1
+ export{a as Code}from'./_chunks/chunk-P5L5LN6E.js';//# sourceMappingURL=Code.js.map
3
2
  //# sourceMappingURL=Code.js.map
package/dist/Code.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"Code.js"}
package/dist/Heading.js CHANGED
@@ -1,3 +1,2 @@
1
- export { a as Heading } from './_chunks/chunk-6FIUWNC7.js';
2
- //# sourceMappingURL=out.js.map
1
+ export{a as Heading}from'./_chunks/chunk-6FIUWNC7.js';//# sourceMappingURL=Heading.js.map
3
2
  //# sourceMappingURL=Heading.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"Heading.js"}
package/dist/Text.js CHANGED
@@ -1,3 +1,2 @@
1
- export { a as Text } from './_chunks/chunk-GSK3G4DW.js';
2
- //# sourceMappingURL=out.js.map
1
+ export{a as Text}from'./_chunks/chunk-GSK3G4DW.js';//# sourceMappingURL=Text.js.map
3
2
  //# sourceMappingURL=Text.js.map
package/dist/Text.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"Text.js"}
package/dist/View.js CHANGED
@@ -1,3 +1,2 @@
1
- export { a as View } from './_chunks/chunk-RJEJUZ3O.js';
2
- //# sourceMappingURL=out.js.map
1
+ export{a as View}from'./_chunks/chunk-RJEJUZ3O.js';//# sourceMappingURL=View.js.map
3
2
  //# sourceMappingURL=View.js.map
package/dist/View.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"View.js"}
@@ -1,9 +1,2 @@
1
- import { ark } from '@ark-ui/react/factory';
2
- import { styled } from '@oztix/roadie-core/jsx';
3
- import { heading } from '@oztix/roadie-core/recipes';
4
-
5
- var r=styled(ark.h2,heading);r.displayName="Heading";
6
-
7
- export { r as a };
8
- //# sourceMappingURL=out.js.map
1
+ import {ark}from'@ark-ui/react/factory';import {styled}from'@oztix/roadie-core/jsx';import {heading}from'@oztix/roadie-core/recipes';var r=styled(ark.h2,heading);r.displayName="Heading";export{r as a};//# sourceMappingURL=chunk-6FIUWNC7.js.map
9
2
  //# sourceMappingURL=chunk-6FIUWNC7.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Heading/index.tsx"],"names":["ark","styled","heading","Heading"],"mappings":"AAEA,OAAS,OAAAA,MAAW,wBAGpB,OAA+B,UAAAC,MAAc,yBAC7C,OAAmC,WAAAC,MAAe,6BAwC3C,IAAMC,EAAUF,EACrBD,EAAI,GACJE,CACF,EAEAC,EAAQ,YAAc","sourcesContent":["import type { ReactNode } from 'react'\n\nimport { ark } from '@ark-ui/react/factory'\n\nimport type { ColorPalette } from '@oztix/roadie-core'\nimport { type HTMLStyledProps, styled } from '@oztix/roadie-core/jsx'\nimport { type HeadingVariantProps, heading } from '@oztix/roadie-core/recipes'\nimport type { JsxStyleProps } from '@oztix/roadie-core/types'\n\ntype HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label'\ntype HeadingStyle = Extract<JsxStyleProps['textStyle'], `display.${string}`>\n\n/**\n * A heading component that uses display styles for titles and section headers\n */\nexport interface HeadingProps extends HTMLStyledProps<'h2'> {\n /**\n * The heading element to render\n * @default 'h2'\n */\n as?: HeadingElement\n\n /**\n * The text style to use for the heading\n * @default 'display.ui'\n */\n textStyle?: HeadingStyle\n\n /**\n * The color palette to use for the heading\n * @default 'neutral'\n */\n colorPalette?: ColorPalette\n\n /**\n * Set a sepecific empahasis level for differen fonts like subtitles\n * @default 'default'\n */\n emphasis?: HeadingVariantProps['emphasis']\n\n /**\n * The content to display\n */\n children?: ReactNode\n}\n\nexport const Heading = styled(\n ark.h2,\n heading\n) as React.ForwardRefExoticComponent<HeadingProps>\n\nHeading.displayName = 'Heading'\n"]}
1
+ {"version":3,"sources":["../../src/components/Heading/index.tsx"],"names":["Heading","styled","ark","heading"],"mappings":"qIA8CO,IAAMA,EAAUC,MAAAA,CACrBC,GAAAA,CAAI,GACJC,OACF,EAEAH,EAAQ,WAAA,CAAc,SAAA","file":"chunk-6FIUWNC7.js","sourcesContent":["import type { ReactNode } from 'react'\n\nimport { ark } from '@ark-ui/react/factory'\n\nimport type { ColorPalette } from '@oztix/roadie-core'\nimport { type HTMLStyledProps, styled } from '@oztix/roadie-core/jsx'\nimport { type HeadingVariantProps, heading } from '@oztix/roadie-core/recipes'\nimport type { JsxStyleProps } from '@oztix/roadie-core/types'\n\ntype HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label'\ntype HeadingStyle = Extract<JsxStyleProps['textStyle'], `display.${string}`>\n\n/**\n * A heading component that uses display styles for titles and section headers\n */\nexport interface HeadingProps extends HTMLStyledProps<'h2'> {\n /**\n * The heading element to render\n * @default 'h2'\n */\n as?: HeadingElement\n\n /**\n * The text style to use for the heading\n * @default 'display.ui'\n */\n textStyle?: HeadingStyle\n\n /**\n * The color palette to use for the heading\n * @default 'neutral'\n */\n colorPalette?: ColorPalette\n\n /**\n * Set a sepecific empahasis level for differen fonts like subtitles\n * @default 'default'\n */\n emphasis?: HeadingVariantProps['emphasis']\n\n /**\n * The content to display\n */\n children?: ReactNode\n}\n\nexport const Heading = styled(\n ark.h2,\n heading\n) as React.ForwardRefExoticComponent<HeadingProps>\n\nHeading.displayName = 'Heading'\n"]}
@@ -1,9 +1,2 @@
1
- import { ark } from '@ark-ui/react/factory';
2
- import { styled } from '@oztix/roadie-core/jsx';
3
- import { text } from '@oztix/roadie-core/recipes';
4
-
5
- var r=styled(ark.span,text);r.displayName="Text";
6
-
7
- export { r as a };
8
- //# sourceMappingURL=out.js.map
1
+ import {ark}from'@ark-ui/react/factory';import {styled}from'@oztix/roadie-core/jsx';import {text}from'@oztix/roadie-core/recipes';var r=styled(ark.span,text);r.displayName="Text";export{r as a};//# sourceMappingURL=chunk-GSK3G4DW.js.map
9
2
  //# sourceMappingURL=chunk-GSK3G4DW.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Text/index.tsx"],"names":["ark","styled","text","Text"],"mappings":"AAEA,OAAS,OAAAA,MAAW,wBAGpB,OAAS,UAAAC,MAAc,yBAEvB,OAAgC,QAAAC,MAAY,6BAyCrC,IAAMC,EAAOF,EAClBD,EAAI,KACJE,CACF,EAEAC,EAAK,YAAc","sourcesContent":["import type { ReactNode } from 'react'\n\nimport { ark } from '@ark-ui/react/factory'\n\nimport type { ColorPalette } from '@oztix/roadie-core'\nimport { styled } from '@oztix/roadie-core/jsx'\nimport type { HTMLStyledProps } from '@oztix/roadie-core/jsx'\nimport { type TextVariantProps, text } from '@oztix/roadie-core/recipes'\n\n/**\n * Text component for displaying content with various styling options\n */\nexport interface TextProps extends HTMLStyledProps<'span'> {\n /**\n * The visual emphasis of the text\n * @default 'default'\n */\n emphasis?: TextVariantProps['emphasis']\n\n /**\n * Whether the text is interactive\n * @default false\n */\n interactive?: TextVariantProps['interactive']\n\n /**\n * The HTML element to render the text as\n * @default 'span'\n */\n as?: HTMLStyledProps<'span'>['as']\n\n /**\n * The color palette to use for the text\n * @default 'neutral'\n */\n colorPalette?: ColorPalette\n\n /**\n * When true, the component will pass props to its child component\n */\n asChild?: boolean\n\n /**\n * The content to display\n */\n children?: ReactNode\n}\n\nexport const Text = styled(\n ark.span,\n text\n) as React.ForwardRefExoticComponent<TextProps>\n\nText.displayName = 'Text'\n"]}
1
+ {"version":3,"sources":["../../src/components/Text/index.tsx"],"names":["Text","styled","ark","text"],"mappings":"kIAgDO,IAAMA,EAAOC,MAAAA,CAClBC,GAAAA,CAAI,KACJC,IACF,EAEAH,EAAK,WAAA,CAAc,MAAA","file":"chunk-GSK3G4DW.js","sourcesContent":["import type { ReactNode } from 'react'\n\nimport { ark } from '@ark-ui/react/factory'\n\nimport type { ColorPalette } from '@oztix/roadie-core'\nimport { styled } from '@oztix/roadie-core/jsx'\nimport type { HTMLStyledProps } from '@oztix/roadie-core/jsx'\nimport { type TextVariantProps, text } from '@oztix/roadie-core/recipes'\n\n/**\n * Text component for displaying content with various styling options\n */\nexport interface TextProps extends HTMLStyledProps<'span'> {\n /**\n * The visual emphasis of the text\n * @default 'default'\n */\n emphasis?: TextVariantProps['emphasis']\n\n /**\n * Whether the text is interactive\n * @default false\n */\n interactive?: TextVariantProps['interactive']\n\n /**\n * The HTML element to render the text as\n * @default 'span'\n */\n as?: HTMLStyledProps<'span'>['as']\n\n /**\n * The color palette to use for the text\n * @default 'neutral'\n */\n colorPalette?: ColorPalette\n\n /**\n * When true, the component will pass props to its child component\n */\n asChild?: boolean\n\n /**\n * The content to display\n */\n children?: ReactNode\n}\n\nexport const Text = styled(\n ark.span,\n text\n) as React.ForwardRefExoticComponent<TextProps>\n\nText.displayName = 'Text'\n"]}
@@ -1,9 +1,2 @@
1
- import { ark } from '@ark-ui/react/factory';
2
- import { styled } from '@oztix/roadie-core/jsx';
3
- import { code } from '@oztix/roadie-core/recipes';
4
-
5
- var t=styled(ark.code,code);t.displayName="Code";
6
-
7
- export { t as a };
8
- //# sourceMappingURL=out.js.map
1
+ import {ark}from'@ark-ui/react/factory';import {styled}from'@oztix/roadie-core/jsx';import {code}from'@oztix/roadie-core/recipes';var t=styled(ark.code,code);t.displayName="Code";export{t as a};//# sourceMappingURL=chunk-P5L5LN6E.js.map
9
2
  //# sourceMappingURL=chunk-P5L5LN6E.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Code/index.tsx"],"names":["ark","styled","code","Code"],"mappings":"AAEA,OAAS,OAAAA,MAAW,wBAGpB,OAAS,UAAAC,MAAc,yBAEvB,OAAgC,QAAAC,MAAY,6BAwBrC,IAAMC,EAAOF,EAClBD,EAAI,KACJE,CACF,EAEAC,EAAK,YAAc","sourcesContent":["import type { ReactNode } from 'react'\n\nimport { ark } from '@ark-ui/react/factory'\n\nimport type { ColorPalette } from '@oztix/roadie-core'\nimport { styled } from '@oztix/roadie-core/jsx'\nimport type { HTMLStyledProps } from '@oztix/roadie-core/jsx'\nimport { type CodeVariantProps, code } from '@oztix/roadie-core/recipes'\n\n/**\n * A code component that inherits from Text and renders as a code element\n */\nexport interface CodeProps extends HTMLStyledProps<'code'> {\n /**\n * The appearance of the code block\n * @default 'default'\n */\n emphasis?: CodeVariantProps['emphasis']\n\n /**\n * The color palette to use for the code\n * @default 'neutral'\n */\n colorPalette?: ColorPalette\n\n /**\n * The content to display\n */\n children?: ReactNode\n}\n\nexport const Code = styled(\n ark.code,\n code\n) as React.ForwardRefExoticComponent<CodeProps>\n\nCode.displayName = 'Code'\n"]}
1
+ {"version":3,"sources":["../../src/components/Code/index.tsx"],"names":["Code","styled","ark","code"],"mappings":"kIA+BO,IAAMA,EAAOC,MAAAA,CAClBC,GAAAA,CAAI,KACJC,IACF,EAEAH,EAAK,WAAA,CAAc,MAAA","file":"chunk-P5L5LN6E.js","sourcesContent":["import type { ReactNode } from 'react'\n\nimport { ark } from '@ark-ui/react/factory'\n\nimport type { ColorPalette } from '@oztix/roadie-core'\nimport { styled } from '@oztix/roadie-core/jsx'\nimport type { HTMLStyledProps } from '@oztix/roadie-core/jsx'\nimport { type CodeVariantProps, code } from '@oztix/roadie-core/recipes'\n\n/**\n * A code component that inherits from Text and renders as a code element\n */\nexport interface CodeProps extends HTMLStyledProps<'code'> {\n /**\n * The appearance of the code block\n * @default 'default'\n */\n emphasis?: CodeVariantProps['emphasis']\n\n /**\n * The color palette to use for the code\n * @default 'neutral'\n */\n colorPalette?: ColorPalette\n\n /**\n * The content to display\n */\n children?: ReactNode\n}\n\nexport const Code = styled(\n ark.code,\n code\n) as React.ForwardRefExoticComponent<CodeProps>\n\nCode.displayName = 'Code'\n"]}
@@ -1,7 +1,2 @@
1
- import { View } from '@oztix/roadie-core/jsx';
2
-
3
- var t=View;t.displayName="View";
4
-
5
- export { t as a };
6
- //# sourceMappingURL=out.js.map
1
+ import {View}from'@oztix/roadie-core/jsx';var t=View;t.displayName="View";export{t as a};//# sourceMappingURL=chunk-RJEJUZ3O.js.map
7
2
  //# sourceMappingURL=chunk-RJEJUZ3O.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/View/index.tsx"],"names":["ViewPattern","View"],"mappings":"AAAA,OAAS,QAAQA,MAAmB,yBAO7B,IAAMC,EAAOD,EAIpBC,EAAK,YAAc","sourcesContent":["import { View as ViewPattern } from '@oztix/roadie-core/jsx'\n\n/**\n * A foundational layout component that provides a flexible container with sensible defaults.\n * Based on the Panda CSS Box pattern but with better defaults for application UI layout.\n *\n */\nexport const View = ViewPattern\n\nexport type ViewProps = React.ComponentProps<typeof ViewPattern>\n\nView.displayName = 'View'\n"]}
1
+ {"version":3,"sources":["../../src/components/View/index.tsx"],"names":["View","ViewPattern"],"mappings":"8CAOaA,CAAAA,CAAOC,KAIpBD,EAAK,WAAA,CAAc,MAAA","file":"chunk-RJEJUZ3O.js","sourcesContent":["import { View as ViewPattern } from '@oztix/roadie-core/jsx'\n\n/**\n * A foundational layout component that provides a flexible container with sensible defaults.\n * Based on the Panda CSS Box pattern but with better defaults for application UI layout.\n *\n */\nexport const View = ViewPattern\n\nexport type ViewProps = React.ComponentProps<typeof ViewPattern>\n\nView.displayName = 'View'\n"]}
@@ -1,10 +1,2 @@
1
- import 'react';
2
- import { ark } from '@ark-ui/react/factory';
3
- import { styled } from '@oztix/roadie-core/jsx';
4
- import { button } from '@oztix/roadie-core/recipes';
5
-
6
- var r=styled(ark.button,button);r.displayName="Button";
7
-
8
- export { r as a };
9
- //# sourceMappingURL=out.js.map
1
+ import'react';import {ark}from'@ark-ui/react/factory';import {styled}from'@oztix/roadie-core/jsx';import {button}from'@oztix/roadie-core/recipes';var r=styled(ark.button,button);r.displayName="Button";export{r as a};//# sourceMappingURL=chunk-VDMZIGT2.js.map
10
2
  //# sourceMappingURL=chunk-VDMZIGT2.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Button/index.tsx"],"names":["ark","styled","button","Button"],"mappings":"AAAA,MAAkB,QAElB,OAAS,OAAAA,MAAW,wBAGpB,OAAS,UAAAC,MAAc,yBAEvB,OAAkC,UAAAC,MAAc,6BAmCzC,IAAMC,EAASF,EACpBD,EAAI,OACJE,CACF,EAEAC,EAAO,YAAc","sourcesContent":["import React from 'react'\n\nimport { ark } from '@ark-ui/react/factory'\n\nimport type { ColorPalette } from '@oztix/roadie-core'\nimport { styled } from '@oztix/roadie-core/jsx'\nimport type { HTMLStyledProps } from '@oztix/roadie-core/jsx'\nimport { type ButtonVariantProps, button } from '@oztix/roadie-core/recipes'\n\n/**\n * A button component with various emphasis levels and sizes\n */\nexport interface ButtonProps extends HTMLStyledProps<'button'> {\n /**\n * The visual emphasis of the button\n * @default 'default'\n */\n emphasis?: ButtonVariantProps['emphasis']\n\n /**\n * The size of the button\n * @default 'md'\n */\n size?: ButtonVariantProps['size']\n\n /**\n * The color palette to use for the button\n * @default 'neutral'\n */\n colorPalette?: ColorPalette\n\n /**\n * When true, the component will pass props to its child component\n */\n asChild?: boolean\n\n /**\n * The content to display\n */\n children?: React.ReactNode\n}\n\nexport const Button = styled(\n ark.button,\n button\n) as React.ForwardRefExoticComponent<ButtonProps>\n\nButton.displayName = 'Button'\n"]}
1
+ {"version":3,"sources":["../../src/components/Button/index.tsx"],"names":["Button","styled","ark","button"],"mappings":"sJA0CaA,CAAAA,CAASC,MAAAA,CACpBC,IAAI,MAAA,CACJC,MACF,EAEAH,CAAAA,CAAO,WAAA,CAAc,QAAA","file":"chunk-VDMZIGT2.js","sourcesContent":["import React from 'react'\n\nimport { ark } from '@ark-ui/react/factory'\n\nimport type { ColorPalette } from '@oztix/roadie-core'\nimport { styled } from '@oztix/roadie-core/jsx'\nimport type { HTMLStyledProps } from '@oztix/roadie-core/jsx'\nimport { type ButtonVariantProps, button } from '@oztix/roadie-core/recipes'\n\n/**\n * A button component with various emphasis levels and sizes\n */\nexport interface ButtonProps extends HTMLStyledProps<'button'> {\n /**\n * The visual emphasis of the button\n * @default 'default'\n */\n emphasis?: ButtonVariantProps['emphasis']\n\n /**\n * The size of the button\n * @default 'md'\n */\n size?: ButtonVariantProps['size']\n\n /**\n * The color palette to use for the button\n * @default 'neutral'\n */\n colorPalette?: ColorPalette\n\n /**\n * When true, the component will pass props to its child component\n */\n asChild?: boolean\n\n /**\n * The content to display\n */\n children?: React.ReactNode\n}\n\nexport const Button = styled(\n ark.button,\n button\n) as React.ForwardRefExoticComponent<ButtonProps>\n\nButton.displayName = 'Button'\n"]}
@@ -0,0 +1,27 @@
1
+ import { ColorMode } from '@oztix/roadie-core';
2
+
3
+ /**
4
+ * React hook that subscribes to color mode changes.
5
+ * Listens to both localStorage changes and custom colormodechange events.
6
+ *
7
+ * @returns The current color mode ('light' or 'dark')
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import { useColorMode } from '@oztix/roadie-components'
12
+ * import { toggleColorMode } from '@oztix/roadie-core'
13
+ *
14
+ * function ColorModeToggle() {
15
+ * const colorMode = useColorMode()
16
+ *
17
+ * return (
18
+ * <button onClick={() => toggleColorMode()}>
19
+ * Current mode: {colorMode}
20
+ * </button>
21
+ * )
22
+ * }
23
+ * ```
24
+ */
25
+ declare function useColorMode(): ColorMode;
26
+
27
+ export { useColorMode };
@@ -0,0 +1,2 @@
1
+ import {useSyncExternalStore}from'react';import {subscribeToColorMode,getColorMode}from'@oztix/roadie-core';function d(){return useSyncExternalStore(subscribeToColorMode,getColorMode,()=>"light")}export{d as useColorMode};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/hooks/useColorMode.ts"],"names":["useColorMode","useSyncExternalStore","subscribeToColorMode","getColorMode"],"mappings":"4GA8BO,SAASA,CAAAA,EAA0B,CACxC,OAAOC,oBAAAA,CACLC,qBACAC,YAAAA,CACA,IAAM,OACR,CACF","file":"index.js","sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport {\n type ColorMode,\n getColorMode,\n subscribeToColorMode\n} from '@oztix/roadie-core'\n\n/**\n * React hook that subscribes to color mode changes.\n * Listens to both localStorage changes and custom colormodechange events.\n *\n * @returns The current color mode ('light' or 'dark')\n *\n * @example\n * ```tsx\n * import { useColorMode } from '@oztix/roadie-components'\n * import { toggleColorMode } from '@oztix/roadie-core'\n *\n * function ColorModeToggle() {\n * const colorMode = useColorMode()\n *\n * return (\n * <button onClick={() => toggleColorMode()}>\n * Current mode: {colorMode}\n * </button>\n * )\n * }\n * ```\n */\nexport function useColorMode(): ColorMode {\n return useSyncExternalStore(\n subscribeToColorMode,\n getColorMode,\n () => 'light' // Server snapshot\n )\n}\n"]}
package/dist/index.js CHANGED
@@ -1,7 +1,2 @@
1
- export { a as Button } from './_chunks/chunk-VDMZIGT2.js';
2
- export { a as Code } from './_chunks/chunk-P5L5LN6E.js';
3
- export { a as Heading } from './_chunks/chunk-6FIUWNC7.js';
4
- export { a as Text } from './_chunks/chunk-GSK3G4DW.js';
5
- export { a as View } from './_chunks/chunk-RJEJUZ3O.js';
6
- //# sourceMappingURL=out.js.map
1
+ export{a as Button}from'./_chunks/chunk-VDMZIGT2.js';export{a as Code}from'./_chunks/chunk-P5L5LN6E.js';export{a as Heading}from'./_chunks/chunk-6FIUWNC7.js';export{a as Text}from'./_chunks/chunk-GSK3G4DW.js';export{a as View}from'./_chunks/chunk-RJEJUZ3O.js';//# sourceMappingURL=index.js.map
7
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@oztix/roadie-components",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "The components for Roadie Design System at Oztix",
5
5
  "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/TicketSolutionsPtyLtd/roadie"
9
+ },
6
10
  "main": "./dist/index.js",
7
11
  "module": "./dist/index.js",
8
12
  "types": "./dist/index.d.ts",
@@ -12,6 +16,11 @@
12
16
  "import": "./dist/index.js",
13
17
  "require": "./dist/index.js"
14
18
  },
19
+ "./hooks": {
20
+ "types": "./dist/hooks/index.d.ts",
21
+ "import": "./dist/hooks/index.js",
22
+ "require": "./dist/hooks/index.js"
23
+ },
15
24
  "./src/*": {
16
25
  "types": "./src/*",
17
26
  "import": "./src/*"
@@ -31,23 +40,22 @@
31
40
  },
32
41
  "dependencies": {
33
42
  "@ark-ui/react": "5.26.2",
34
- "@oztix/roadie-core": "1.0.0"
43
+ "@oztix/roadie-core": "1.1.0"
35
44
  },
36
45
  "devDependencies": {
37
46
  "@pandacss/dev": "1.4.3",
38
- "@testing-library/jest-dom": "6.1.6",
39
- "@testing-library/react": "15.0.0",
40
- "@testing-library/user-event": "14.5.1",
41
- "@types/node": "22.10.2",
42
- "@types/react": "19.0.2",
43
- "@types/react-dom": "19.0.2",
44
- "@vitejs/plugin-react": "4.3.4",
45
- "@vitest/coverage-v8": "1.6.0",
46
- "@vitest/ui": "1.6.0",
47
- "jsdom": "24.1.3",
48
- "tsup": "8.0.0",
49
- "typescript": "5.7.2",
50
- "vitest": "1.6.0"
47
+ "@testing-library/jest-dom": "6.9.1",
48
+ "@testing-library/react": "16.3.0",
49
+ "@testing-library/user-event": "14.6.1",
50
+ "@types/node": "24.9.2",
51
+ "@types/react": "19.2.2",
52
+ "@types/react-dom": "19.2.2",
53
+ "@vitejs/plugin-react": "5.1.0",
54
+ "@vitest/coverage-v8": "4.0.4",
55
+ "@vitest/ui": "4.0.4",
56
+ "jsdom": "27.0.1",
57
+ "tsup": "8.5.0",
58
+ "vitest": "4.0.4"
51
59
  },
52
60
  "author": {
53
61
  "name": "Luke Brooker",
@@ -68,15 +76,14 @@
68
76
  "build": "tsup",
69
77
  "clean": "rm -rf node_modules dist",
70
78
  "dev": "tsup --watch",
71
- "pretest": "panda codegen",
72
79
  "test": "vitest run",
73
80
  "test:watch": "vitest",
74
81
  "test:coverage": "vitest run --coverage",
75
82
  "test:ui": "vitest --ui",
76
83
  "format": "prettier --ignore-path ../../.prettierignore --write \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
77
84
  "format:check": "prettier --ignore-path ../../.prettierignore --check \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
78
- "lint": "eslint --ignore-path ../../.eslintignore . --ext .ts,.tsx",
79
- "lint:fix": "eslint --ignore-path ../../.eslintignore . --ext .ts,.tsx --fix",
85
+ "lint": "eslint .",
86
+ "lint:fix": "eslint . --fix",
80
87
  "typecheck": "tsc --noEmit"
81
88
  }
82
89
  }
@@ -0,0 +1 @@
1
+ export * from './useColorMode'
@@ -0,0 +1,37 @@
1
+ import { useSyncExternalStore } from 'react'
2
+
3
+ import {
4
+ type ColorMode,
5
+ getColorMode,
6
+ subscribeToColorMode
7
+ } from '@oztix/roadie-core'
8
+
9
+ /**
10
+ * React hook that subscribes to color mode changes.
11
+ * Listens to both localStorage changes and custom colormodechange events.
12
+ *
13
+ * @returns The current color mode ('light' or 'dark')
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * import { useColorMode } from '@oztix/roadie-components'
18
+ * import { toggleColorMode } from '@oztix/roadie-core'
19
+ *
20
+ * function ColorModeToggle() {
21
+ * const colorMode = useColorMode()
22
+ *
23
+ * return (
24
+ * <button onClick={() => toggleColorMode()}>
25
+ * Current mode: {colorMode}
26
+ * </button>
27
+ * )
28
+ * }
29
+ * ```
30
+ */
31
+ export function useColorMode(): ColorMode {
32
+ return useSyncExternalStore(
33
+ subscribeToColorMode,
34
+ getColorMode,
35
+ () => 'light' // Server snapshot
36
+ )
37
+ }