@oztix/roadie-components 0.2.1 → 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.
Files changed (57) hide show
  1. package/dist/Button.d.ts +31 -111
  2. package/dist/Button.js +1 -2
  3. package/dist/Button.js.map +1 -1
  4. package/dist/Code.d.ts +15 -5
  5. package/dist/Code.js +1 -2
  6. package/dist/Code.js.map +1 -1
  7. package/dist/Heading.d.ts +23 -6
  8. package/dist/Heading.js +1 -2
  9. package/dist/Heading.js.map +1 -1
  10. package/dist/Text.d.ts +24 -37
  11. package/dist/Text.js +1 -2
  12. package/dist/Text.js.map +1 -1
  13. package/dist/View.d.ts +7 -70
  14. package/dist/View.js +1 -2
  15. package/dist/View.js.map +1 -1
  16. package/dist/_chunks/chunk-6FIUWNC7.js +2 -0
  17. package/dist/_chunks/chunk-6FIUWNC7.js.map +1 -0
  18. package/dist/_chunks/chunk-GSK3G4DW.js +2 -0
  19. package/dist/_chunks/chunk-GSK3G4DW.js.map +1 -0
  20. package/dist/_chunks/chunk-P5L5LN6E.js +2 -0
  21. package/dist/_chunks/chunk-P5L5LN6E.js.map +1 -0
  22. package/dist/_chunks/chunk-RJEJUZ3O.js +2 -0
  23. package/dist/_chunks/chunk-RJEJUZ3O.js.map +1 -0
  24. package/dist/_chunks/chunk-VDMZIGT2.js +2 -0
  25. package/dist/_chunks/chunk-VDMZIGT2.js.map +1 -0
  26. package/dist/hooks/index.d.ts +27 -0
  27. package/dist/hooks/index.js +2 -0
  28. package/dist/hooks/index.js.map +1 -0
  29. package/dist/index.d.ts +5 -6
  30. package/dist/index.js +1 -6
  31. package/dist/index.js.map +1 -1
  32. package/package.json +33 -21
  33. package/src/components/Button/Button.test.tsx +156 -0
  34. package/src/components/Button/index.tsx +48 -0
  35. package/src/components/Code/Code.test.tsx +85 -0
  36. package/src/components/Code/index.tsx +37 -0
  37. package/src/components/Heading/Heading.test.tsx +128 -0
  38. package/src/components/Heading/index.tsx +52 -0
  39. package/src/components/Text/Text.test.tsx +121 -0
  40. package/src/components/Text/index.tsx +54 -0
  41. package/src/components/View/View.test.tsx +161 -0
  42. package/src/components/View/index.tsx +12 -0
  43. package/src/components/index.ts +14 -0
  44. package/src/hooks/index.ts +1 -0
  45. package/src/hooks/useColorMode.ts +37 -0
  46. package/src/index.test.tsx +37 -0
  47. package/src/index.tsx +5 -0
  48. package/dist/_chunks/chunk-5EABNA3A.js +0 -8
  49. package/dist/_chunks/chunk-5EABNA3A.js.map +0 -1
  50. package/dist/_chunks/chunk-72747LP3.js +0 -8
  51. package/dist/_chunks/chunk-72747LP3.js.map +0 -1
  52. package/dist/_chunks/chunk-76TTGNAE.js +0 -8
  53. package/dist/_chunks/chunk-76TTGNAE.js.map +0 -1
  54. package/dist/_chunks/chunk-CNVMCX74.js +0 -8
  55. package/dist/_chunks/chunk-CNVMCX74.js.map +0 -1
  56. package/dist/_chunks/chunk-JDVDZGUN.js +0 -9
  57. package/dist/_chunks/chunk-JDVDZGUN.js.map +0 -1
@@ -0,0 +1,121 @@
1
+ import { render } from '@testing-library/react'
2
+ import { describe, expect, it } from 'vitest'
3
+
4
+ import { Text } from './index'
5
+
6
+ describe('Text', () => {
7
+ it('renders with default props', () => {
8
+ const { getByText } = render(<Text>Hello World</Text>)
9
+ const text = getByText('Hello World')
10
+ expect(text).toBeInTheDocument()
11
+ expect(text.tagName.toLowerCase()).toBe('span')
12
+ expect(text).toHaveClass('text', 'text--emphasis_default')
13
+ })
14
+
15
+ it('applies textStyle prop', () => {
16
+ const { getByText } = render(<Text textStyle='heading.1'>Large Text</Text>)
17
+ const text = getByText('Large Text')
18
+ expect(text).toHaveClass('textStyle_heading.1')
19
+ })
20
+
21
+ it('renders with custom element type', () => {
22
+ const { getByText } = render(<Text as='p'>Paragraph Text</Text>)
23
+ const element = getByText('Paragraph Text')
24
+ expect(element.tagName.toLowerCase()).toBe('p')
25
+ })
26
+
27
+ it('renders with different emphasis', () => {
28
+ const { rerender, getByText } = render(
29
+ <Text emphasis='strong'>Strong Text</Text>
30
+ )
31
+ let text = getByText('Strong Text')
32
+ expect(text).toHaveClass('text--emphasis_strong')
33
+
34
+ rerender(<Text emphasis='subtle'>Subtle Text</Text>)
35
+ text = getByText('Subtle Text')
36
+ expect(text).toHaveClass('text--emphasis_subtle')
37
+
38
+ rerender(<Text emphasis='subtler'>subtler Text</Text>)
39
+ text = getByText('subtler Text')
40
+ expect(text).toHaveClass('text--emphasis_subtler')
41
+
42
+ rerender(<Text emphasis='default'>Default Text</Text>)
43
+ text = getByText('Default Text')
44
+ expect(text).toHaveClass('text--emphasis_default')
45
+ })
46
+
47
+ it('renders with different color palettes', () => {
48
+ const { rerender, getByText } = render(
49
+ <Text colorPalette='accent'>Accent Text</Text>
50
+ )
51
+ let text = getByText('Accent Text')
52
+ expect(text).toHaveClass('color-palette_accent')
53
+
54
+ rerender(<Text colorPalette='brand'>Brand Text</Text>)
55
+ text = getByText('Brand Text')
56
+ expect(text).toHaveClass('color-palette_brand')
57
+
58
+ rerender(<Text colorPalette='success'>Success Text</Text>)
59
+ text = getByText('Success Text')
60
+ expect(text).toHaveClass('color-palette_success')
61
+
62
+ rerender(<Text colorPalette='warning'>Warning Text</Text>)
63
+ text = getByText('Warning Text')
64
+ expect(text).toHaveClass('color-palette_warning')
65
+
66
+ rerender(<Text colorPalette='danger'>Danger Text</Text>)
67
+ text = getByText('Danger Text')
68
+ expect(text).toHaveClass('color-palette_danger')
69
+ })
70
+
71
+ it('applies interactive styles', () => {
72
+ const { getByText } = render(<Text interactive>Interactive Text</Text>)
73
+ const text = getByText('Interactive Text')
74
+ expect(text).toHaveClass('text--interactive_true')
75
+ })
76
+
77
+ it('applies line clamp prop', () => {
78
+ const { getByText } = render(
79
+ <Text lineClamp={2}>Multi-line text that should be clamped</Text>
80
+ )
81
+ const text = getByText('Multi-line text that should be clamped')
82
+ expect(text).toHaveClass('lc_2')
83
+ })
84
+
85
+ it('forwards additional HTML attributes', () => {
86
+ const { getByTestId } = render(
87
+ <Text data-testid='text' title='tooltip' aria-label='Accessible text'>
88
+ Text with attributes
89
+ </Text>
90
+ )
91
+ const text = getByTestId('text')
92
+ expect(text).toHaveClass('text')
93
+ expect(text).toHaveAttribute('title', 'tooltip')
94
+ expect(text).toHaveAttribute('aria-label', 'Accessible text')
95
+ })
96
+
97
+ it('combines multiple props', () => {
98
+ const { getByText } = render(
99
+ <Text
100
+ textStyle='heading.2'
101
+ emphasis='strong'
102
+ colorPalette='accent'
103
+ interactive
104
+ lineClamp={2}
105
+ className='custom-class'
106
+ >
107
+ Styled Text
108
+ </Text>
109
+ )
110
+ const text = getByText('Styled Text')
111
+ expect(text).toHaveClass(
112
+ 'text',
113
+ 'text--emphasis_strong',
114
+ 'text--interactive_true',
115
+ 'textStyle_heading.2',
116
+ 'color-palette_accent',
117
+ 'lc_2',
118
+ 'custom-class'
119
+ )
120
+ })
121
+ })
@@ -0,0 +1,54 @@
1
+ import type { ReactNode } from 'react'
2
+
3
+ import { ark } from '@ark-ui/react/factory'
4
+
5
+ import type { ColorPalette } from '@oztix/roadie-core'
6
+ import { styled } from '@oztix/roadie-core/jsx'
7
+ import type { HTMLStyledProps } from '@oztix/roadie-core/jsx'
8
+ import { type TextVariantProps, text } from '@oztix/roadie-core/recipes'
9
+
10
+ /**
11
+ * Text component for displaying content with various styling options
12
+ */
13
+ export interface TextProps extends HTMLStyledProps<'span'> {
14
+ /**
15
+ * The visual emphasis of the text
16
+ * @default 'default'
17
+ */
18
+ emphasis?: TextVariantProps['emphasis']
19
+
20
+ /**
21
+ * Whether the text is interactive
22
+ * @default false
23
+ */
24
+ interactive?: TextVariantProps['interactive']
25
+
26
+ /**
27
+ * The HTML element to render the text as
28
+ * @default 'span'
29
+ */
30
+ as?: HTMLStyledProps<'span'>['as']
31
+
32
+ /**
33
+ * The color palette to use for the text
34
+ * @default 'neutral'
35
+ */
36
+ colorPalette?: ColorPalette
37
+
38
+ /**
39
+ * When true, the component will pass props to its child component
40
+ */
41
+ asChild?: boolean
42
+
43
+ /**
44
+ * The content to display
45
+ */
46
+ children?: ReactNode
47
+ }
48
+
49
+ export const Text = styled(
50
+ ark.span,
51
+ text
52
+ ) as React.ForwardRefExoticComponent<TextProps>
53
+
54
+ Text.displayName = 'Text'
@@ -0,0 +1,161 @@
1
+ import { render } from '@testing-library/react'
2
+ import { describe, expect, it } from 'vitest'
3
+
4
+ import { View } from './index'
5
+
6
+ describe('View', () => {
7
+ it('renders with default props', () => {
8
+ const { getByTestId } = render(<View data-testid='view'>Content</View>)
9
+ const view = getByTestId('view')
10
+ expect(view).toBeInTheDocument()
11
+ expect(view.tagName.toLowerCase()).toBe('div')
12
+ expect(view).toHaveClass(
13
+ 'd_flex',
14
+ 'pos_relative',
15
+ 'flex-d_column',
16
+ 'flex-wrap_nowrap',
17
+ 'ai_stretch',
18
+ 'ac_flex-start',
19
+ 'jc_flex-start',
20
+ 'min-h_0',
21
+ 'min-w_0'
22
+ )
23
+ })
24
+
25
+ it('renders with different HTML elements', () => {
26
+ const elements: Array<'section' | 'article' | 'aside' | 'main'> = [
27
+ 'section',
28
+ 'article',
29
+ 'aside',
30
+ 'main'
31
+ ]
32
+
33
+ elements.forEach((element) => {
34
+ const { rerender, getByTestId } = render(
35
+ <View as={element} data-testid='view'>
36
+ {element} content
37
+ </View>
38
+ )
39
+ const view = getByTestId('view')
40
+ expect(view.tagName.toLowerCase()).toBe(element)
41
+ expect(view).toHaveClass(
42
+ 'd_flex',
43
+ 'pos_relative',
44
+ 'flex-d_column',
45
+ 'flex-wrap_nowrap',
46
+ 'ai_stretch',
47
+ 'ac_flex-start',
48
+ 'jc_flex-start',
49
+ 'min-h_0',
50
+ 'min-w_0'
51
+ )
52
+ rerender(<></>)
53
+ })
54
+ })
55
+
56
+ it('applies layout properties', () => {
57
+ const { getByTestId } = render(
58
+ <View
59
+ data-testid='view'
60
+ display='inline-flex'
61
+ position='absolute'
62
+ flexDirection='row'
63
+ flexWrap='wrap'
64
+ alignItems='center'
65
+ alignContent='center'
66
+ justifyContent='center'
67
+ >
68
+ Styled View
69
+ </View>
70
+ )
71
+ const view = getByTestId('view')
72
+ expect(view).toHaveClass(
73
+ 'd_inline-flex',
74
+ 'pos_absolute',
75
+ 'flex-d_row',
76
+ 'flex-wrap_wrap',
77
+ 'ai_center',
78
+ 'ac_center',
79
+ 'jc_center',
80
+ 'min-h_0',
81
+ 'min-w_0'
82
+ )
83
+ })
84
+
85
+ it('applies custom styles and attributes', () => {
86
+ const { getByTestId } = render(
87
+ <View
88
+ data-testid='view'
89
+ backgroundColor='neutral.bg.subtle'
90
+ padding='200'
91
+ title='tooltip'
92
+ aria-label='Accessible view'
93
+ >
94
+ Custom View
95
+ </View>
96
+ )
97
+ const view = getByTestId('view')
98
+ expect(view).toHaveClass('bg-c_neutral.bg.subtle', 'p_200')
99
+ expect(view).toHaveAttribute('title', 'tooltip')
100
+ expect(view).toHaveAttribute('aria-label', 'Accessible view')
101
+ })
102
+
103
+ it('renders nested views', () => {
104
+ const { getByTestId } = render(
105
+ <View data-testid='parent'>
106
+ <View data-testid='child'>Nested Content</View>
107
+ </View>
108
+ )
109
+ const parent = getByTestId('parent')
110
+ const child = getByTestId('child')
111
+ expect(parent).toContainElement(child)
112
+ expect(child).toHaveTextContent('Nested Content')
113
+ expect(parent).toHaveClass(
114
+ 'd_flex',
115
+ 'pos_relative',
116
+ 'flex-d_column',
117
+ 'flex-wrap_nowrap',
118
+ 'ai_stretch',
119
+ 'ac_flex-start',
120
+ 'jc_flex-start',
121
+ 'min-h_0',
122
+ 'min-w_0'
123
+ )
124
+ expect(child).toHaveClass(
125
+ 'd_flex',
126
+ 'pos_relative',
127
+ 'flex-d_column',
128
+ 'flex-wrap_nowrap',
129
+ 'ai_stretch',
130
+ 'ac_flex-start',
131
+ 'jc_flex-start',
132
+ 'min-h_0',
133
+ 'min-w_0'
134
+ )
135
+ })
136
+
137
+ it('combines multiple props', () => {
138
+ const { getByTestId } = render(
139
+ <View
140
+ as='section'
141
+ display='grid'
142
+ gap='200'
143
+ padding='400'
144
+ backgroundColor='neutral.bg.subtle'
145
+ className='custom-class'
146
+ data-testid='view'
147
+ >
148
+ Combined styles
149
+ </View>
150
+ )
151
+ const view = getByTestId('view')
152
+ expect(view.tagName.toLowerCase()).toBe('section')
153
+ expect(view).toHaveClass(
154
+ 'd_grid',
155
+ 'gap_200',
156
+ 'p_400',
157
+ 'bg-c_neutral.bg.subtle',
158
+ 'custom-class'
159
+ )
160
+ })
161
+ })
@@ -0,0 +1,12 @@
1
+ import { View as ViewPattern } from '@oztix/roadie-core/jsx'
2
+
3
+ /**
4
+ * A foundational layout component that provides a flexible container with sensible defaults.
5
+ * Based on the Panda CSS Box pattern but with better defaults for application UI layout.
6
+ *
7
+ */
8
+ export const View = ViewPattern
9
+
10
+ export type ViewProps = React.ComponentProps<typeof ViewPattern>
11
+
12
+ View.displayName = 'View'
@@ -0,0 +1,14 @@
1
+ export { Button } from './Button'
2
+ export type { ButtonProps } from './Button'
3
+
4
+ export { Code } from './Code'
5
+ export type { CodeProps } from './Code'
6
+
7
+ export { Heading } from './Heading'
8
+ export type { HeadingProps } from './Heading'
9
+
10
+ export { Text } from './Text'
11
+ export type { TextProps } from './Text'
12
+
13
+ export { View } from './View'
14
+ export type { ViewProps } from './View'
@@ -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
+ }
@@ -0,0 +1,37 @@
1
+ import '@testing-library/jest-dom/vitest'
2
+ import { render } from '@testing-library/react'
3
+ import { describe, expect, it } from 'vitest'
4
+
5
+ import { Button, Code, Heading, Text, View } from './index'
6
+
7
+ describe('Component exports', () => {
8
+ it('exports Button component', () => {
9
+ expect(Button).toBeDefined()
10
+ const { container } = render(<Button>Test</Button>)
11
+ expect(container).toBeInTheDocument()
12
+ })
13
+
14
+ it('exports Code component', () => {
15
+ expect(Code).toBeDefined()
16
+ const { container } = render(<Code>Test</Code>)
17
+ expect(container).toBeInTheDocument()
18
+ })
19
+
20
+ it('exports Heading component', () => {
21
+ expect(Heading).toBeDefined()
22
+ const { container } = render(<Heading>Test</Heading>)
23
+ expect(container).toBeInTheDocument()
24
+ })
25
+
26
+ it('exports Text component', () => {
27
+ expect(Text).toBeDefined()
28
+ const { container } = render(<Text>Test</Text>)
29
+ expect(container).toBeInTheDocument()
30
+ })
31
+
32
+ it('exports View component', () => {
33
+ expect(View).toBeDefined()
34
+ const { container } = render(<View>Test</View>)
35
+ expect(container).toBeInTheDocument()
36
+ })
37
+ })
package/src/index.tsx ADDED
@@ -0,0 +1,5 @@
1
+ export * from './components/Button'
2
+ export * from './components/Code'
3
+ export * from './components/Heading'
4
+ export * from './components/Text'
5
+ export * from './components/View'
@@ -1,8 +0,0 @@
1
- import 'react';
2
- import { styled } from '@oztix/roadie-core/jsx';
3
-
4
- var t=styled("h2",{base:{textStyle:"display.ui",color:"accent.fg.strong"}});t.displayName="Heading";
5
-
6
- export { t as a };
7
- //# sourceMappingURL=out.js.map
8
- //# sourceMappingURL=chunk-5EABNA3A.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Heading/index.tsx"],"names":["styled","Heading"],"mappings":"AAAA,MAAkB,QAGlB,OAAS,UAAAA,MAAc,yBAwBhB,IAAMC,EAAUD,EAAO,KAAM,CAClC,KAAM,CACJ,UAAW,aACX,MAAO,kBACT,CACF,CAAC,EAEDC,EAAQ,YAAc","sourcesContent":["import React from 'react'\n\nimport type { HTMLStyledProps } from '@oztix/roadie-core/jsx'\nimport { styled } from '@oztix/roadie-core/jsx'\nimport type { JsxStyleProps } from '@oztix/roadie-core/types'\n\ntype HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n\n/**\n * A heading component that uses display styles for titles and section headers\n */\nexport interface HeadingProps extends HTMLStyledProps<'h2'>, JsxStyleProps {\n /**\n * The heading level to render\n * @default 'h2'\n */\n as?: HeadingLevel\n /**\n * The text style to use for the heading\n * @default 'display.ui'\n */\n textStyle?: Extract<\n JsxStyleProps['textStyle'],\n 'display' | `display${string}`\n >\n}\n\nexport const Heading = styled('h2', {\n base: {\n textStyle: 'display.ui',\n color: 'accent.fg.strong'\n }\n}) as React.ForwardRefExoticComponent<HeadingProps>\n\nHeading.displayName = 'Heading'\n"]}
@@ -1,8 +0,0 @@
1
- import 'react';
2
- import { styled } from '@oztix/roadie-core/jsx';
3
-
4
- var t=styled("div",{base:{display:"flex",position:"relative",flexDirection:"column",flexWrap:"nowrap",alignItems:"stretch",alignContent:"flex-start",justifyContent:"flex-start",minHeight:0,minWidth:0}}),o=t;o.displayName="View";
5
-
6
- export { o as a };
7
- //# sourceMappingURL=out.js.map
8
- //# sourceMappingURL=chunk-72747LP3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/View/index.tsx"],"names":["styled","StyledView","View"],"mappings":"AACA,MAAkB,QAElB,OAAS,UAAAA,MAAc,yBAiFvB,IAAMC,EAAaD,EAAO,MAAO,CAC/B,KAAM,CACJ,QAAS,OACT,SAAU,WACV,cAAe,SACf,SAAU,SACV,WAAY,UACZ,aAAc,aACd,eAAgB,aAChB,UAAW,EACX,SAAU,CACZ,CACF,CAAC,EAEYE,EAAOD,EAEpBC,EAAK,YAAc","sourcesContent":["import type { ElementType } from 'react'\nimport React from 'react'\n\nimport { styled } from '@oztix/roadie-core/jsx'\nimport type { JsxStyleProps } from '@oztix/roadie-core/types'\n\ntype AsProp<C extends ElementType> = {\n as?: C\n}\n\ntype PropsToOmit<C extends ElementType, P> = keyof (AsProp<C> & P)\n\n/**\n * A foundational layout component that provides a flexible container with sensible defaults.\n */\nexport interface ViewProps<C extends ElementType = 'div'> {\n /**\n * The HTML element or React component to render the View as\n * @default 'div'\n */\n as?: C\n /**\n * The display property of the View\n * @default 'flex'\n */\n display?: JsxStyleProps['display']\n /**\n * The position property of the View\n * @default 'relative'\n */\n position?: JsxStyleProps['position']\n /**\n * The flex direction property of the View\n * @default 'column'\n */\n flexDirection?: JsxStyleProps['flexDirection']\n /**\n * The flex wrap property of the View\n * @default 'nowrap'\n */\n flexWrap?: JsxStyleProps['flexWrap']\n /**\n * The align items property of the View\n * @default 'stretch'\n */\n alignItems?: JsxStyleProps['alignItems']\n /**\n * The align self property of the View\n * @default 'flex-start'\n */\n alignSelf?: JsxStyleProps['alignSelf']\n /**\n * The align content property of the View\n * @default 'flex-start'\n */\n alignContent?: JsxStyleProps['alignContent']\n /**\n * The justify content property of the View\n * @default 'flex-start'\n */\n justifyContent?: JsxStyleProps['justifyContent']\n /**\n * The min height property of the View\n * @default '0'\n */\n minHeight?: JsxStyleProps['minHeight']\n /**\n * The min width property of the View\n * @default '0'\n */\n minWidth?: JsxStyleProps['minWidth']\n}\n\nexport type PolymorphicViewProps<C extends ElementType> = ViewProps<C> &\n Omit<React.ComponentPropsWithRef<C>, PropsToOmit<C, ViewProps>> &\n JsxStyleProps\n\ntype ViewComponent = {\n <C extends ElementType = 'div'>(\n props: PolymorphicViewProps<C>\n ): React.ReactElement | null\n displayName?: string\n}\n\nconst StyledView = styled('div', {\n base: {\n display: 'flex',\n position: 'relative',\n flexDirection: 'column',\n flexWrap: 'nowrap',\n alignItems: 'stretch',\n alignContent: 'flex-start',\n justifyContent: 'flex-start',\n minHeight: 0,\n minWidth: 0\n }\n})\n\nexport const View = StyledView as ViewComponent\n\nView.displayName = 'View'\n"]}
@@ -1,8 +0,0 @@
1
- import 'react';
2
- import { styled } from '@oztix/roadie-core/jsx';
3
-
4
- var e=styled("code",{base:{backgroundColor:"neutral.surface.subtle",textStyle:"code",px:"050",borderRadius:"050",border:"1px solid"},variants:{emphasis:{default:{borderColor:"neutral.border",backgroundColor:"neutral.surface.subtle"},strong:{borderColor:"neutral.border.strong",backgroundColor:"neutral.surface.strong"},subtle:{borderColor:"neutral.border.subtle"},muted:{borderColor:"transparent"}}},defaultVariants:{emphasis:"default"}});e.displayName="Code";
5
-
6
- export { e as a };
7
- //# sourceMappingURL=out.js.map
8
- //# sourceMappingURL=chunk-76TTGNAE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Code/index.tsx"],"names":["styled","Code"],"mappings":"AAAA,MAAkB,QAGlB,OAAS,UAAAA,MAAc,yBAchB,IAAMC,EAAOD,EAAO,OAAQ,CACjC,KAAM,CACJ,gBAAiB,yBACjB,UAAW,OACX,GAAI,MACJ,aAAc,MACd,OAAQ,WACV,EACA,SAAU,CACR,SAAU,CACR,QAAS,CACP,YAAa,iBACb,gBAAiB,wBACnB,EACA,OAAQ,CACN,YAAa,wBACb,gBAAiB,wBACnB,EACA,OAAQ,CACN,YAAa,uBACf,EACA,MAAO,CACL,YAAa,aACf,CACF,CACF,EACA,gBAAiB,CACf,SAAU,SACZ,CACF,CAAC,EAEDC,EAAK,YAAc","sourcesContent":["import React from 'react'\n\nimport type { HTMLStyledProps } from '@oztix/roadie-core/jsx'\nimport { styled } from '@oztix/roadie-core/jsx'\nimport type { JsxStyleProps } from '@oztix/roadie-core/types'\n\n/**\n * A code component that inherits from Text and renders as a code element\n */\nexport interface CodeProps extends HTMLStyledProps<'code'>, JsxStyleProps {\n /**\n * The appearance of the code block\n * @default 'outline'\n */\n emphasis?: 'default' | 'strong' | 'subtle' | 'muted'\n}\n\nexport const Code = styled('code', {\n base: {\n backgroundColor: 'neutral.surface.subtle',\n textStyle: 'code',\n px: '050',\n borderRadius: '050',\n border: '1px solid'\n },\n variants: {\n emphasis: {\n default: {\n borderColor: 'neutral.border',\n backgroundColor: 'neutral.surface.subtle'\n },\n strong: {\n borderColor: 'neutral.border.strong',\n backgroundColor: 'neutral.surface.strong'\n },\n subtle: {\n borderColor: 'neutral.border.subtle'\n },\n muted: {\n borderColor: 'transparent'\n }\n }\n },\n defaultVariants: {\n emphasis: 'default'\n }\n}) as React.ForwardRefExoticComponent<CodeProps>\n\nCode.displayName = 'Code'\n"]}
@@ -1,8 +0,0 @@
1
- import 'react';
2
- import { styled } from '@oztix/roadie-core/jsx';
3
-
4
- var t=styled("span",{base:{textStyle:"ui",color:"colorPalette.fg"},variants:{emphasis:{default:{color:"colorPalette.fg"},strong:{color:"colorPalette.fg.strong",fontWeight:"semibold"},subtle:{color:"colorPalette.fg.subtle"},muted:{color:"colorPalette.fg.muted"}},interactive:{true:{cursor:"pointer",_hover:{color:"colorPalette.fg.hover"},_focus:{color:"colorPalette.fg.hover"},_active:{color:"colorPalette.fg.active"},_groupHover:{color:"colorPalette.fg.hover"},_groupFocus:{color:"colorPalette.fg.hover"},_groupActive:{color:"colorPalette.fg.active"}}}},defaultVariants:{emphasis:"default",interactive:!1}}),o=t;o.displayName="Text";
5
-
6
- export { o as a };
7
- //# sourceMappingURL=out.js.map
8
- //# sourceMappingURL=chunk-CNVMCX74.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Text/index.tsx"],"names":["styled","StyledText","Text"],"mappings":"AACA,MAAkB,QAElB,OAAS,UAAAA,MAAc,yBAmEvB,IAAMC,EAAaD,EAAO,OAAQ,CAChC,KAAM,CACJ,UAAW,KACX,MAAO,iBACT,EACA,SAAU,CACR,SAAU,CACR,QAAS,CACP,MAAO,iBACT,EACA,OAAQ,CACN,MAAO,yBACP,WAAY,UACd,EACA,OAAQ,CACN,MAAO,wBACT,EACA,MAAO,CACL,MAAO,uBACT,CACF,EACA,YAAa,CACX,KAAM,CACJ,OAAQ,UACR,OAAQ,CACN,MAAO,uBACT,EACA,OAAQ,CACN,MAAO,uBACT,EACA,QAAS,CACP,MAAO,wBACT,EACA,YAAa,CACX,MAAO,uBACT,EACA,YAAa,CACX,MAAO,uBACT,EACA,aAAc,CACZ,MAAO,wBACT,CACF,CACF,CACF,EACA,gBAAiB,CACf,SAAU,UACV,YAAa,EACf,CACF,CAAC,EAEYE,EAAOD,EAEpBC,EAAK,YAAc","sourcesContent":["import type { ElementType } from 'react'\nimport React from 'react'\n\nimport { styled } from '@oztix/roadie-core/jsx'\nimport type { JsxStyleProps } from '@oztix/roadie-core/types'\n\ntype AsProp<C extends ElementType> = {\n as?: C\n}\n\ntype PropsToOmit<C extends ElementType, P> = keyof (AsProp<C> & P)\n\n/**\n * A foundational text component that is responsive and customizable.\n */\nexport interface TextProps<C extends ElementType = 'span'> {\n /**\n * The HTML element or React component to render the Text as\n * @default 'span'\n */\n as?: C\n /**\n * Controls the font family, line height, and letter spacing of the text.\n * @default 'ui'\n */\n textStyle?: JsxStyleProps['textStyle']\n /**\n * The color of the text\n * @default 'neutral'\n */\n colorPalette?:\n | 'neutral'\n | 'accent'\n | 'brand'\n | 'information'\n | 'success'\n | 'warning'\n | 'danger'\n /**\n * The emphasis of the text\n * - default: For standard body text and general content\n * - strong: For text that needs visual emphasis or importance, like headings, key terms or warnings\n * - subtle: For secondary or supplementary text that should be visually de-emphasized\n * - muted: For text that should be visually muted, like placeholder text or disabled text\n * @default 'default'\n */\n emphasis?: 'default' | 'strong' | 'subtle' | 'muted'\n /**\n * Whether the text is interactive. Adds hover, focus, and active styles. Includes group styles.\n * @default false\n */\n interactive?: boolean\n /**\n * The line clamp of the text. Useful for limiting the number of lines of text in a component.\n * @default 'none'\n */\n lineClamp?: JsxStyleProps['lineClamp']\n}\n\nexport type PolymorphicTextProps<C extends ElementType> = TextProps<C> &\n Omit<React.ComponentPropsWithRef<C>, PropsToOmit<C, TextProps>> &\n JsxStyleProps\n\ntype TextComponent = {\n <C extends ElementType = 'span'>(\n props: PolymorphicTextProps<C>\n ): React.ReactElement | null\n displayName?: string\n}\n\nconst StyledText = styled('span', {\n base: {\n textStyle: 'ui',\n color: 'colorPalette.fg'\n },\n variants: {\n emphasis: {\n default: {\n color: 'colorPalette.fg'\n },\n strong: {\n color: 'colorPalette.fg.strong',\n fontWeight: 'semibold'\n },\n subtle: {\n color: 'colorPalette.fg.subtle'\n },\n muted: {\n color: 'colorPalette.fg.muted'\n }\n },\n interactive: {\n true: {\n cursor: 'pointer',\n _hover: {\n color: 'colorPalette.fg.hover'\n },\n _focus: {\n color: 'colorPalette.fg.hover'\n },\n _active: {\n color: 'colorPalette.fg.active'\n },\n _groupHover: {\n color: 'colorPalette.fg.hover'\n },\n _groupFocus: {\n color: 'colorPalette.fg.hover'\n },\n _groupActive: {\n color: 'colorPalette.fg.active'\n }\n }\n }\n },\n defaultVariants: {\n emphasis: 'default',\n interactive: false\n }\n})\n\nexport const Text = StyledText as TextComponent\n\nText.displayName = 'Text'\n"]}
@@ -1,9 +0,0 @@
1
- import { Button } from 'react-aria-components';
2
- import { cva, cx } from '@oztix/roadie-core/css';
3
- import { jsx } from 'react/jsx-runtime';
4
-
5
- var d=cva({base:{display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",borderRadius:"050",fontWeight:"medium",fontFamily:"ui",cursor:"pointer",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s",color:"colorPalette.fg",_hover:{color:"colorPalette.fg.hover"},_active:{color:"colorPalette.fg.active"},_disabled:{opacity:.4,cursor:"not-allowed",color:"colorPalette.fg.subtle"},_focusVisible:{outlineColor:"colorPalette.border.strong",outlineWidth:"2px",outlineStyle:"solid",outlineOffset:"2px"}},variants:{emphasis:{strong:{color:"colorPalette.fg.inverted",backgroundColor:"colorPalette.solid.strong",_hover:{color:"colorPalette.fg.inverted.hover",backgroundColor:"colorPalette.solid.strong.hover"},_active:{color:"colorPalette.fg.inverted.active",backgroundColor:"colorPalette.solid.strong.active"}},default:{borderColor:"colorPalette.border",backgroundColor:"colorPalette.surface.subtle",_hover:{borderColor:"colorPalette.border.hover",backgroundColor:"colorPalette.surface.subtle.hover"},_active:{borderColor:"colorPalette.border.active",backgroundColor:"colorPalette.surface.subtle.active"}},subtle:{backgroundColor:"colorPalette.solid.subtle",_hover:{backgroundColor:"colorPalette.solid.subtle.hover"},_active:{backgroundColor:"colorPalette.solid.subtle.active"}},muted:{_hover:{backgroundColor:"colorPalette.solid.subtle.hover"},_active:{backgroundColor:"colorPalette.solid.subtle.active"}}},colorPalette:{neutral:{colorPalette:"neutral"},accent:{colorPalette:"accent"},brand:{colorPalette:"brand"},information:{colorPalette:"information"},success:{colorPalette:"success"},warning:{colorPalette:"warning"},danger:{colorPalette:"danger"}},size:{sm:{minHeight:"400",fontSize:"sm",px:"200",py:"075"},md:{minHeight:"500",fontSize:"md",px:"200",py:"100"},lg:{minHeight:"600",fontSize:"lg",px:"300",py:"150"}}},defaultVariants:{emphasis:"default",colorPalette:"neutral",size:"md"}});function f({children:o,emphasis:e="default",size:t="md",colorPalette:r="neutral",isDisabled:l=!1,onPress:a,className:n,...c}){return jsx(Button,{onPress:a,isDisabled:l,className:cx(d({emphasis:e,size:t,colorPalette:r}),n),...c,children:o})}
6
-
7
- export { d as a, f as b };
8
- //# sourceMappingURL=out.js.map
9
- //# sourceMappingURL=chunk-JDVDZGUN.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Button/index.tsx"],"names":["AriaButton","cva","cx","jsx","buttonRecipe","Button","children","emphasis","size","colorPalette","isDisabled","onPress","className","props"],"mappings":"AAAA,OACE,UAAUA,MAEL,wBAEP,OAAS,OAAAC,EAAK,MAAAC,MAAU,yBA6KpB,cAAAC,MAAA,oBA5IG,IAAMC,EAAeH,EAAI,CAC9B,KAAM,CACJ,QAAS,cACT,WAAY,SACZ,eAAgB,SAChB,gBAAiB,cACjB,aAAc,MACd,WAAY,SACZ,WAAY,KACZ,OAAQ,UACR,YAAa,MACb,YAAa,QACb,YAAa,cACb,WAAY,WACZ,MAAO,kBACP,OAAQ,CACN,MAAO,uBACT,EACA,QAAS,CACP,MAAO,wBACT,EACA,UAAW,CACT,QAAS,GACT,OAAQ,cACR,MAAO,wBACT,EACA,cAAe,CACb,aAAc,6BACd,aAAc,MACd,aAAc,QACd,cAAe,KACjB,CACF,EACA,SAAU,CACR,SAAU,CACR,OAAQ,CACN,MAAO,2BACP,gBAAiB,4BACjB,OAAQ,CACN,MAAO,iCACP,gBAAiB,iCACnB,EACA,QAAS,CACP,MAAO,kCACP,gBAAiB,kCACnB,CACF,EACA,QAAS,CACP,YAAa,sBACb,gBAAiB,8BACjB,OAAQ,CACN,YAAa,4BACb,gBAAiB,mCACnB,EACA,QAAS,CACP,YAAa,6BACb,gBAAiB,oCACnB,CACF,EACA,OAAQ,CACN,gBAAiB,4BAEjB,OAAQ,CACN,gBAAiB,iCACnB,EACA,QAAS,CACP,gBAAiB,kCACnB,CACF,EACA,MAAO,CACL,OAAQ,CACN,gBAAiB,iCACnB,EACA,QAAS,CACP,gBAAiB,kCACnB,CACF,CACF,EACA,aAAc,CACZ,QAAS,CACP,aAAc,SAChB,EACA,OAAQ,CACN,aAAc,QAChB,EACA,MAAO,CACL,aAAc,OAChB,EACA,YAAa,CACX,aAAc,aAChB,EACA,QAAS,CACP,aAAc,SAChB,EACA,QAAS,CACP,aAAc,SAChB,EACA,OAAQ,CACN,aAAc,QAChB,CACF,EACA,KAAM,CACJ,GAAI,CACF,UAAW,MACX,SAAU,KACV,GAAI,MACJ,GAAI,KACN,EACA,GAAI,CACF,UAAW,MACX,SAAU,KACV,GAAI,MACJ,GAAI,KACN,EACA,GAAI,CACF,UAAW,MACX,SAAU,KACV,GAAI,MACJ,GAAI,KACN,CACF,CACF,EACA,gBAAiB,CACf,SAAU,UACV,aAAc,UACd,KAAM,IACR,CACF,CAAC,EAEM,SAASI,EAAO,CACrB,SAAAC,EACA,SAAAC,EAAW,UACX,KAAAC,EAAO,KACP,aAAAC,EAAe,UACf,WAAAC,EAAa,GACb,QAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAgB,CACd,OACEV,EAACH,EAAA,CACC,QAASW,EACT,WAAYD,EACZ,UAAWR,EAAGE,EAAa,CAAE,SAAAG,EAAU,KAAAC,EAAM,aAAAC,CAAa,CAAC,EAAGG,CAAS,EACtE,GAAGC,EAEH,SAAAP,EACH,CAEJ","sourcesContent":["import {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps\n} from 'react-aria-components'\n\nimport { cva, cx } from '@oztix/roadie-core/css'\n\n/**\n * Button emphasis variants\n */\ntype ButtonEmphasis = 'strong' | 'default' | 'subtle' | 'muted'\n\n/**\n * Button size variants\n */\ntype ButtonSize = 'sm' | 'md' | 'lg'\n\n/**\n * Props for the Button component\n */\nexport interface ButtonProps extends Omit<AriaButtonProps, 'className'> {\n /** The visual style of the button */\n emphasis?: ButtonEmphasis\n /** The size of the button */\n size?: ButtonSize\n /** The color palette to use for the button */\n colorPalette?:\n | 'neutral'\n | 'accent'\n | 'brand'\n | 'information'\n | 'success'\n | 'warning'\n | 'danger'\n /** Additional class names to be applied to the button */\n className?: string\n}\n\nexport const buttonRecipe = cva({\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'transparent',\n borderRadius: '050',\n fontWeight: 'medium',\n fontFamily: 'ui',\n cursor: 'pointer',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: 'transparent',\n transition: 'all 0.2s',\n color: 'colorPalette.fg',\n _hover: {\n color: 'colorPalette.fg.hover'\n },\n _active: {\n color: 'colorPalette.fg.active'\n },\n _disabled: {\n opacity: 0.4,\n cursor: 'not-allowed',\n color: 'colorPalette.fg.subtle'\n },\n _focusVisible: {\n outlineColor: 'colorPalette.border.strong',\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineOffset: '2px'\n }\n },\n variants: {\n emphasis: {\n strong: {\n color: 'colorPalette.fg.inverted',\n backgroundColor: 'colorPalette.solid.strong',\n _hover: {\n color: 'colorPalette.fg.inverted.hover',\n backgroundColor: 'colorPalette.solid.strong.hover'\n },\n _active: {\n color: 'colorPalette.fg.inverted.active',\n backgroundColor: 'colorPalette.solid.strong.active'\n }\n },\n default: {\n borderColor: 'colorPalette.border',\n backgroundColor: 'colorPalette.surface.subtle',\n _hover: {\n borderColor: 'colorPalette.border.hover',\n backgroundColor: 'colorPalette.surface.subtle.hover'\n },\n _active: {\n borderColor: 'colorPalette.border.active',\n backgroundColor: 'colorPalette.surface.subtle.active'\n }\n },\n subtle: {\n backgroundColor: 'colorPalette.solid.subtle',\n\n _hover: {\n backgroundColor: 'colorPalette.solid.subtle.hover'\n },\n _active: {\n backgroundColor: 'colorPalette.solid.subtle.active'\n }\n },\n muted: {\n _hover: {\n backgroundColor: 'colorPalette.solid.subtle.hover'\n },\n _active: {\n backgroundColor: 'colorPalette.solid.subtle.active'\n }\n }\n },\n colorPalette: {\n neutral: {\n colorPalette: 'neutral'\n },\n accent: {\n colorPalette: 'accent'\n },\n brand: {\n colorPalette: 'brand'\n },\n information: {\n colorPalette: 'information'\n },\n success: {\n colorPalette: 'success'\n },\n warning: {\n colorPalette: 'warning'\n },\n danger: {\n colorPalette: 'danger'\n }\n },\n size: {\n sm: {\n minHeight: '400',\n fontSize: 'sm',\n px: '200',\n py: '075'\n },\n md: {\n minHeight: '500',\n fontSize: 'md',\n px: '200',\n py: '100'\n },\n lg: {\n minHeight: '600',\n fontSize: 'lg',\n px: '300',\n py: '150'\n }\n }\n },\n defaultVariants: {\n emphasis: 'default',\n colorPalette: 'neutral',\n size: 'md'\n }\n})\n\nexport function Button({\n children,\n emphasis = 'default',\n size = 'md',\n colorPalette = 'neutral',\n isDisabled = false,\n onPress,\n className,\n ...props\n}: ButtonProps) {\n return (\n <AriaButton\n onPress={onPress}\n isDisabled={isDisabled}\n className={cx(buttonRecipe({ emphasis, size, colorPalette }), className)}\n {...props}\n >\n {children}\n </AriaButton>\n )\n}\n"]}