@ark-ui/react 1.0.0-beta.0 → 1.0.0-beta.2

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/CHANGELOG.md CHANGED
@@ -6,6 +6,26 @@ description: All notable changes to this project will be documented in this file
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.0-beta.2] - 2023-10-25
10
+
11
+ ### Added
12
+
13
+ - Added `ValueText` to the `ColorPicker` component
14
+
15
+ ### Fixed
16
+
17
+ - Added missing data attributes to `DatePickerView` component
18
+
19
+ ## [1.0.0-beta.1] - 2023-10-20
20
+
21
+ ### Added
22
+
23
+ - Parsed `focusedValue` in `DatePicker`
24
+
25
+ ### Fixed
26
+
27
+ - Resolved an issue with `@ark-ui/anatomy`
28
+
9
29
  ## [1.0.0-beta.0] - 2023-10-20
10
30
 
11
31
  ### Changed
@@ -5,7 +5,7 @@ import type { Assign } from '../types';
5
5
  interface TransparancyGridProps {
6
6
  size: string;
7
7
  }
8
- export interface ColorPickerTransparencyGridPrps extends Assign<HTMLArkProps<'div'>, TransparancyGridProps> {
8
+ export interface ColorPickerTransparencyGridProps extends Assign<HTMLArkProps<'div'>, TransparancyGridProps> {
9
9
  }
10
- export declare const ColorPickerTransparencyGrid: ForwardRefExoticComponent<ColorPickerTransparencyGridPrps & RefAttributes<HTMLDivElement>>;
10
+ export declare const ColorPickerTransparencyGrid: ForwardRefExoticComponent<ColorPickerTransparencyGridProps & RefAttributes<HTMLDivElement>>;
11
11
  export {};
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const anatomy = require('@ark-ui/anatomy');
8
+ const react = require('react');
9
+ const factory = require('../factory.cjs');
10
+ const colorPickerContext = require('./color-picker-context.cjs');
11
+
12
+ const ColorPickerValueText = react.forwardRef(
13
+ (props, ref) => {
14
+ const api = colorPickerContext.useColorPickerContext();
15
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...anatomy.colorPickerAnatomy.build().valueText.attrs, ...props, ref, children: props.children || api.valueAsString });
16
+ }
17
+ );
18
+ ColorPickerValueText.displayName = "ColorPickerValueText";
19
+
20
+ exports.ColorPickerValueText = ColorPickerValueText;
@@ -0,0 +1,6 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ /// <reference types="react" />
3
+ import { type HTMLArkProps } from '../factory';
4
+ export interface ColorPickerValueTextProps extends HTMLArkProps<'span'> {
5
+ }
6
+ export declare const ColorPickerValueText: ForwardRefExoticComponent<ColorPickerValueTextProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,16 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { colorPickerAnatomy } from '@ark-ui/anatomy';
4
+ import { forwardRef } from 'react';
5
+ import { ark } from '../factory.mjs';
6
+ import { useColorPickerContext } from './color-picker-context.mjs';
7
+
8
+ const ColorPickerValueText = forwardRef(
9
+ (props, ref) => {
10
+ const api = useColorPickerContext();
11
+ return /* @__PURE__ */ jsx(ark.span, { ...colorPickerAnatomy.build().valueText.attrs, ...props, ref, children: props.children || api.valueAsString });
12
+ }
13
+ );
14
+ ColorPickerValueText.displayName = "ColorPickerValueText";
15
+
16
+ export { ColorPickerValueText };
@@ -24,6 +24,7 @@ const colorPickerSwatchGroup = require('./color-picker-swatch-group.cjs');
24
24
  const colorPickerSwatchTrigger = require('./color-picker-swatch-trigger.cjs');
25
25
  const colorPickerTransparencyGrid = require('./color-picker-transparency-grid.cjs');
26
26
  const colorPickerTrigger = require('./color-picker-trigger.cjs');
27
+ const colorPickerValueText = require('./color-picker-value-text.cjs');
27
28
 
28
29
  const ColorPicker = Object.assign(colorPicker.ColorPicker, {
29
30
  Root: colorPicker.ColorPicker,
@@ -43,7 +44,8 @@ const ColorPicker = Object.assign(colorPicker.ColorPicker, {
43
44
  SwatchGroup: colorPickerSwatchGroup.ColorPickerSwatchGroup,
44
45
  SwatchTrigger: colorPickerSwatchTrigger.ColorPickerSwatchTrigger,
45
46
  TransparencyGrid: colorPickerTransparencyGrid.ColorPickerTransparencyGrid,
46
- Trigger: colorPickerTrigger.ColorPickerTrigger
47
+ Trigger: colorPickerTrigger.ColorPickerTrigger,
48
+ ValueText: colorPickerValueText.ColorPickerValueText
47
49
  });
48
50
 
49
51
  exports.ColorPickerArea = colorPickerArea.ColorPickerArea;
@@ -66,4 +68,5 @@ exports.ColorPickerSwatchGroup = colorPickerSwatchGroup.ColorPickerSwatchGroup;
66
68
  exports.ColorPickerSwatchTrigger = colorPickerSwatchTrigger.ColorPickerSwatchTrigger;
67
69
  exports.ColorPickerTransparencyGrid = colorPickerTransparencyGrid.ColorPickerTransparencyGrid;
68
70
  exports.ColorPickerTrigger = colorPickerTrigger.ColorPickerTrigger;
71
+ exports.ColorPickerValueText = colorPickerValueText.ColorPickerValueText;
69
72
  exports.ColorPicker = ColorPicker;
@@ -19,8 +19,9 @@ import { ColorPickerPositioner, type ColorPickerPositionerProps } from './color-
19
19
  import { ColorPickerSwatch, type ColorPickerSwatchProps } from './color-picker-swatch';
20
20
  import { ColorPickerSwatchGroup, type ColorPickerSwatchGroupProps } from './color-picker-swatch-group';
21
21
  import { ColorPickerSwatchTrigger, type ColorPickerSwatchTriggerProps } from './color-picker-swatch-trigger';
22
- import { ColorPickerTransparencyGrid, type ColorPickerTransparencyGridPrps } from './color-picker-transparency-grid';
22
+ import { ColorPickerTransparencyGrid, type ColorPickerTransparencyGridProps } from './color-picker-transparency-grid';
23
23
  import { ColorPickerTrigger, type ColorPickerTriggerProps } from './color-picker-trigger';
24
+ import { ColorPickerValueText, type ColorPickerValueTextProps } from './color-picker-value-text';
24
25
  declare const ColorPicker: ForwardRefExoticComponent<ColorPickerProps & RefAttributes<HTMLDivElement>> & {
25
26
  Root: ForwardRefExoticComponent<ColorPickerProps & RefAttributes<HTMLDivElement>>;
26
27
  Area: ForwardRefExoticComponent<ColorPickerAreaProps & RefAttributes<HTMLDivElement>>;
@@ -38,8 +39,9 @@ declare const ColorPicker: ForwardRefExoticComponent<ColorPickerProps & RefAttri
38
39
  Swatch: ForwardRefExoticComponent<ColorPickerSwatchProps & RefAttributes<HTMLDivElement>>;
39
40
  SwatchGroup: ForwardRefExoticComponent<ColorPickerSwatchGroupProps & RefAttributes<HTMLDivElement>>;
40
41
  SwatchTrigger: ForwardRefExoticComponent<ColorPickerSwatchTriggerProps & RefAttributes<HTMLButtonElement>>;
41
- TransparencyGrid: ForwardRefExoticComponent<ColorPickerTransparencyGridPrps & RefAttributes<HTMLDivElement>>;
42
+ TransparencyGrid: ForwardRefExoticComponent<ColorPickerTransparencyGridProps & RefAttributes<HTMLDivElement>>;
42
43
  Trigger: ForwardRefExoticComponent<ColorPickerTriggerProps & RefAttributes<HTMLButtonElement>>;
44
+ ValueText: ForwardRefExoticComponent<ColorPickerValueTextProps & RefAttributes<HTMLDivElement>>;
43
45
  };
44
- export { ColorPicker, ColorPickerArea, ColorPickerAreaBackground, ColorPickerAreaThumb, ColorPickerChannelInput, ColorPickerChannelSlider, ColorPickerChannelSliderThumb, ColorPickerChannelSliderTrack, ColorPickerContent, ColorPickerControl, ColorPickerEyeDropperTrigger, ColorPickerLabel, ColorPickerPositioner, ColorPickerSwatch, ColorPickerSwatchGroup, ColorPickerSwatchTrigger, ColorPickerTransparencyGrid, ColorPickerTrigger, useColorPickerAreaContext, useColorPickerChannelSliderContext, useColorPickerContext, };
45
- export type { ColorPickerAreaBackgroundProps, ColorPickerAreaContext, ColorPickerAreaProps, ColorPickerAreaThumbProps, ColorPickerChannelInputProps, ColorPickerChannelSliderContext, ColorPickerChannelSliderProps, ColorPickerChannelSliderThumbProps, ColorPickerChannelSliderTrackProps, ColorPickerContentProps, ColorPickerContext, ColorPickerControlProps, ColorPickerEyeDropperTriggerProps, ColorPickerLabelProps, ColorPickerPositionerProps, ColorPickerProps, ColorPickerSwatchGroupProps, ColorPickerSwatchProps, ColorPickerSwatchTriggerProps, ColorPickerTransparencyGridPrps, ColorPickerTriggerProps, };
46
+ export { ColorPicker, ColorPickerArea, ColorPickerAreaBackground, ColorPickerAreaThumb, ColorPickerChannelInput, ColorPickerChannelSlider, ColorPickerChannelSliderThumb, ColorPickerChannelSliderTrack, ColorPickerContent, ColorPickerControl, ColorPickerEyeDropperTrigger, ColorPickerLabel, ColorPickerPositioner, ColorPickerSwatch, ColorPickerSwatchGroup, ColorPickerSwatchTrigger, ColorPickerTransparencyGrid, ColorPickerTrigger, ColorPickerValueText, useColorPickerAreaContext, useColorPickerChannelSliderContext, useColorPickerContext, };
47
+ export type { ColorPickerAreaBackgroundProps, ColorPickerAreaContext, ColorPickerAreaProps, ColorPickerAreaThumbProps, ColorPickerChannelInputProps, ColorPickerChannelSliderContext, ColorPickerChannelSliderProps, ColorPickerChannelSliderThumbProps, ColorPickerChannelSliderTrackProps, ColorPickerContentProps, ColorPickerContext, ColorPickerControlProps, ColorPickerEyeDropperTriggerProps, ColorPickerLabelProps, ColorPickerPositionerProps, ColorPickerProps, ColorPickerSwatchGroupProps, ColorPickerSwatchProps, ColorPickerSwatchTriggerProps, ColorPickerTransparencyGridProps, ColorPickerTriggerProps, ColorPickerValueTextProps, };
@@ -20,6 +20,7 @@ import { ColorPickerSwatchGroup } from './color-picker-swatch-group.mjs';
20
20
  import { ColorPickerSwatchTrigger } from './color-picker-swatch-trigger.mjs';
21
21
  import { ColorPickerTransparencyGrid } from './color-picker-transparency-grid.mjs';
22
22
  import { ColorPickerTrigger } from './color-picker-trigger.mjs';
23
+ import { ColorPickerValueText } from './color-picker-value-text.mjs';
23
24
 
24
25
  const ColorPicker = Object.assign(ColorPicker$1, {
25
26
  Root: ColorPicker$1,
@@ -39,7 +40,8 @@ const ColorPicker = Object.assign(ColorPicker$1, {
39
40
  SwatchGroup: ColorPickerSwatchGroup,
40
41
  SwatchTrigger: ColorPickerSwatchTrigger,
41
42
  TransparencyGrid: ColorPickerTransparencyGrid,
42
- Trigger: ColorPickerTrigger
43
+ Trigger: ColorPickerTrigger,
44
+ ValueText: ColorPickerValueText
43
45
  });
44
46
 
45
- export { ColorPicker, ColorPickerArea, ColorPickerAreaBackground, ColorPickerAreaThumb, ColorPickerChannelInput, ColorPickerChannelSlider, ColorPickerChannelSliderThumb, ColorPickerChannelSliderTrack, ColorPickerContent, ColorPickerControl, ColorPickerEyeDropperTrigger, ColorPickerLabel, ColorPickerPositioner, ColorPickerSwatch, ColorPickerSwatchGroup, ColorPickerSwatchTrigger, ColorPickerTransparencyGrid, ColorPickerTrigger };
47
+ export { ColorPicker, ColorPickerArea, ColorPickerAreaBackground, ColorPickerAreaThumb, ColorPickerChannelInput, ColorPickerChannelSlider, ColorPickerChannelSliderThumb, ColorPickerChannelSliderTrack, ColorPickerContent, ColorPickerControl, ColorPickerEyeDropperTrigger, ColorPickerLabel, ColorPickerPositioner, ColorPickerSwatch, ColorPickerSwatchGroup, ColorPickerSwatchTrigger, ColorPickerTransparencyGrid, ColorPickerTrigger, ColorPickerValueText };
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
 
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
+ const anatomy = require('@ark-ui/anatomy');
7
8
  const react = require('react');
8
9
  const createSplitProps = require('../create-split-props.cjs');
9
10
  const factory = require('../factory.cjs');
@@ -17,7 +18,16 @@ const DatePickerView = react.forwardRef((props, ref) => {
17
18
  ]);
18
19
  const api = datePickerContext.useDatePickerContext();
19
20
  const view = runIfFn.runIfFn(children, api);
20
- return /* @__PURE__ */ jsxRuntime.jsx(datePickerViewContext.DatePickerViewProvider, { value: viewProps, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...localProps, ref, hidden: api.view !== viewProps.view, children: view }) });
21
+ return /* @__PURE__ */ jsxRuntime.jsx(datePickerViewContext.DatePickerViewProvider, { value: viewProps, children: /* @__PURE__ */ jsxRuntime.jsx(
22
+ factory.ark.div,
23
+ {
24
+ hidden: api.view !== viewProps.view,
25
+ ...anatomy.datePickerAnatomy.build().view.attrs,
26
+ ...localProps,
27
+ ref,
28
+ children: view
29
+ }
30
+ ) });
21
31
  });
22
32
  DatePickerView.displayName = "DatePickerView";
23
33
 
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
+ import { datePickerAnatomy } from '@ark-ui/anatomy';
3
4
  import { forwardRef } from 'react';
4
5
  import { createSplitProps } from '../create-split-props.mjs';
5
6
  import { ark } from '../factory.mjs';
@@ -13,7 +14,16 @@ const DatePickerView = forwardRef((props, ref) => {
13
14
  ]);
14
15
  const api = useDatePickerContext();
15
16
  const view = runIfFn(children, api);
16
- return /* @__PURE__ */ jsx(DatePickerViewProvider, { value: viewProps, children: /* @__PURE__ */ jsx(ark.div, { ...localProps, ref, hidden: api.view !== viewProps.view, children: view }) });
17
+ return /* @__PURE__ */ jsx(DatePickerViewProvider, { value: viewProps, children: /* @__PURE__ */ jsx(
18
+ ark.div,
19
+ {
20
+ hidden: api.view !== viewProps.view,
21
+ ...datePickerAnatomy.build().view.attrs,
22
+ ...localProps,
23
+ ref,
24
+ children: view
25
+ }
26
+ ) });
17
27
  });
18
28
  DatePickerView.displayName = "DatePickerView";
19
29
 
@@ -34,6 +34,7 @@ const useDatePicker = (props = {}) => {
34
34
  id: react.useId(),
35
35
  getRootNode: environmentContext.useEnvironmentContext(),
36
36
  ...props,
37
+ focusedValue: props.focusedValue ? datePicker__namespace.parse(props.focusedValue) : void 0,
37
38
  value: props.defaultValue ? datePicker__namespace.parse(props.defaultValue) : void 0
38
39
  };
39
40
  const context = {
@@ -1,11 +1,15 @@
1
1
  import * as datePicker from '@zag-js/date-picker';
2
2
  import { type PropTypes } from '@zag-js/react';
3
3
  import type { Optional } from '../types';
4
- export interface UseDatePickerProps extends Optional<Omit<datePicker.Context, 'value'>, 'id'> {
4
+ export interface UseDatePickerProps extends Optional<Omit<datePicker.Context, 'value' | 'focusedValue'>, 'id'> {
5
5
  /**
6
6
  * The initial value of the date picker
7
7
  */
8
8
  defaultValue?: string[];
9
+ /**
10
+ * The focused date.
11
+ */
12
+ focusedValue?: string;
9
13
  /**
10
14
  * The value of the date picker
11
15
  */
@@ -11,6 +11,7 @@ const useDatePicker = (props = {}) => {
11
11
  id: useId(),
12
12
  getRootNode: useEnvironmentContext(),
13
13
  ...props,
14
+ focusedValue: props.focusedValue ? datePicker.parse(props.focusedValue) : void 0,
14
15
  value: props.defaultValue ? datePicker.parse(props.defaultValue) : void 0
15
16
  };
16
17
  const context = {
package/index.cjs CHANGED
@@ -72,6 +72,7 @@ const colorPickerSwatchGroup = require('./color-picker/color-picker-swatch-group
72
72
  const colorPickerSwatchTrigger = require('./color-picker/color-picker-swatch-trigger.cjs');
73
73
  const colorPickerTransparencyGrid = require('./color-picker/color-picker-transparency-grid.cjs');
74
74
  const colorPickerTrigger = require('./color-picker/color-picker-trigger.cjs');
75
+ const colorPickerValueText = require('./color-picker/color-picker-value-text.cjs');
75
76
  const colorPickerAreaContext = require('./color-picker/color-picker-area-context.cjs');
76
77
  const colorPickerChannelSliderContext = require('./color-picker/color-picker-channel-slider-context.cjs');
77
78
  const colorPickerContext = require('./color-picker/color-picker-context.cjs');
@@ -329,6 +330,7 @@ exports.ColorPickerSwatchGroup = colorPickerSwatchGroup.ColorPickerSwatchGroup;
329
330
  exports.ColorPickerSwatchTrigger = colorPickerSwatchTrigger.ColorPickerSwatchTrigger;
330
331
  exports.ColorPickerTransparencyGrid = colorPickerTransparencyGrid.ColorPickerTransparencyGrid;
331
332
  exports.ColorPickerTrigger = colorPickerTrigger.ColorPickerTrigger;
333
+ exports.ColorPickerValueText = colorPickerValueText.ColorPickerValueText;
332
334
  exports.useColorPickerAreaContext = colorPickerAreaContext.useColorPickerAreaContext;
333
335
  exports.useColorPickerChannelSliderContext = colorPickerChannelSliderContext.useColorPickerChannelSliderContext;
334
336
  exports.useColorPickerContext = colorPickerContext.useColorPickerContext;
package/index.mjs CHANGED
@@ -68,6 +68,7 @@ export { ColorPickerSwatchGroup } from './color-picker/color-picker-swatch-group
68
68
  export { ColorPickerSwatchTrigger } from './color-picker/color-picker-swatch-trigger.mjs';
69
69
  export { ColorPickerTransparencyGrid } from './color-picker/color-picker-transparency-grid.mjs';
70
70
  export { ColorPickerTrigger } from './color-picker/color-picker-trigger.mjs';
71
+ export { ColorPickerValueText } from './color-picker/color-picker-value-text.mjs';
71
72
  export { useColorPickerAreaContext } from './color-picker/color-picker-area-context.mjs';
72
73
  export { useColorPickerChannelSliderContext } from './color-picker/color-picker-channel-slider-context.mjs';
73
74
  export { useColorPickerContext } from './color-picker/color-picker-context.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ark-ui/react",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
5
5
  "keywords": [
6
6
  "accordion",
@@ -59,7 +59,7 @@
59
59
  "release-it": "release-it --config ../../../release-it.json"
60
60
  },
61
61
  "dependencies": {
62
- "@ark-ui/anatomy": "workspace:*",
62
+ "@ark-ui/anatomy": "1.0.0-beta.1",
63
63
  "@zag-js/accordion": "0.26.0",
64
64
  "@zag-js/anatomy": "0.26.0",
65
65
  "@zag-js/avatar": "0.26.0",
@@ -96,21 +96,21 @@
96
96
  },
97
97
  "devDependencies": {
98
98
  "@release-it/keep-a-changelog": "4.0.0",
99
- "@storybook/addon-a11y": "7.4.6",
100
- "@storybook/addon-essentials": "7.4.6",
101
- "@storybook/addons": "7.4.6",
102
- "@storybook/react": "7.4.6",
103
- "@storybook/react-vite": "7.4.6",
99
+ "@storybook/addon-a11y": "7.5.1",
100
+ "@storybook/addon-essentials": "7.5.1",
101
+ "@storybook/addons": "7.5.1",
102
+ "@storybook/react": "7.5.1",
103
+ "@storybook/react-vite": "7.5.1",
104
104
  "@testing-library/dom": "9.3.3",
105
105
  "@testing-library/jest-dom": "6.1.4",
106
106
  "@testing-library/react": "14.0.0",
107
107
  "@testing-library/user-event": "14.5.1",
108
- "@types/jsdom": "21.1.3",
108
+ "@types/jsdom": "21.1.4",
109
109
  "@types/react": "18.2.28",
110
110
  "@types/react-dom": "18.2.13",
111
111
  "@types/testing-library__jest-dom": "5.14.9",
112
- "@typescript-eslint/eslint-plugin": "6.7.5",
113
- "@typescript-eslint/parser": "6.7.5",
112
+ "@typescript-eslint/eslint-plugin": "6.8.0",
113
+ "@typescript-eslint/parser": "6.8.0",
114
114
  "@vitejs/plugin-react": "4.1.0",
115
115
  "@vitest/coverage-v8": "0.34.6",
116
116
  "eslint": "8.51.0",
@@ -118,13 +118,13 @@
118
118
  "eslint-plugin-react-hooks": "4.6.0",
119
119
  "globby": "13.2.2",
120
120
  "jsdom": "22.1.0",
121
- "lucide-react": "0.287.0",
121
+ "lucide-react": "0.288.0",
122
122
  "react": "18.2.0",
123
123
  "react-dom": "18.2.0",
124
124
  "react-frame-component": "5.2.6",
125
125
  "release-it": "16.2.1",
126
126
  "resize-observer-polyfill": "1.5.1",
127
- "storybook": "7.4.6",
127
+ "storybook": "7.5.1",
128
128
  "typescript": "5.2.2",
129
129
  "vite": "4.4.11",
130
130
  "vite-plugin-dts": "3.6.0",