@ark-ui/solid 0.7.2-beta.3 → 0.7.2-beta.5

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,18 @@ description: All notable changes to this project will be documented in this file
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.7.2-beta.5] - 2023-07-05
10
+
11
+ ### Added
12
+
13
+ - solid({ solid: { generate: 'ssr', hydratable: true } })
14
+
15
+ ## [0.7.2-beta.4] - 2023-07-05
16
+
17
+ ### Added
18
+
19
+ - Generate `ssr`
20
+
9
21
  ## [0.7.2-beta.3] - 2023-07-05
10
22
 
11
23
  ### Added
@@ -115,7 +127,7 @@ description: All notable changes to this project will be documented in this file
115
127
  - Add `Toast`
116
128
  - Add `Tooltip`
117
129
 
118
- [unreleased]: https://github.com/chakra-ui/ark/compare/@ark-ui/solid@0.7.2-beta.3...HEAD
130
+ [unreleased]: https://github.com/chakra-ui/ark/compare/@ark-ui/solid@0.7.2-beta.5...HEAD
119
131
  [0.1.0]: https://github.com/chakra-ui/ark/releases/tag/@ark-ui/solid@0.1.0
120
132
  [0.2.0]: https://github.com/chakra-ui/ark/releases/tag/@ark-ui/solid@0.2.0
121
133
  [0.3.0]: https://github.com/chakra-ui/ark/releases/tag/@ark-ui/solid@0.3.0
@@ -127,5 +139,7 @@ description: All notable changes to this project will be documented in this file
127
139
  [0.7.2-beta.0]: https://github.com/chakra-ui/ark/releases/tag/@ark-ui/solid@0.7.2-beta.0
128
140
  [0.7.2-beta.1]: https://github.com/chakra-ui/ark/releases/tag/@ark-ui/solid@0.7.2-beta.1
129
141
  [0.7.2-beta.2]: https://github.com/chakra-ui/ark/releases/tag/@ark-ui/solid@0.7.2-beta.2
130
-
131
142
  [0.7.2-beta.3]: https://github.com/chakra-ui/ark/releases/tag/@ark-ui/solid@0.7.2-beta.3
143
+ [0.7.2-beta.4]: https://github.com/chakra-ui/ark/releases/tag/@ark-ui/solid@0.7.2-beta.4
144
+
145
+ [0.7.2-beta.5]: https://github.com/chakra-ui/ark/releases/tag/@ark-ui/solid@0.7.2-beta.5
@@ -8,7 +8,7 @@ const solidJs = require('solid-js');
8
8
  const factory = require('../factory.cjs');
9
9
  const datePickerContext = require('./date-picker-context.cjs');
10
10
 
11
- const _tmpl$ = /*#__PURE__*/web.template(`<option>`);
11
+ const _tmpl$ = ["<option", ">", "</option>"];
12
12
  const DatePickerMonthSelect = props => {
13
13
  const datePicker = datePickerContext.useDatePickerContext();
14
14
  const mergedProps = solid.mergeProps(() => datePicker().monthSelectProps, props);
@@ -18,12 +18,7 @@ const DatePickerMonthSelect = props => {
18
18
  get each() {
19
19
  return datePicker().getMonths();
20
20
  },
21
- children: month => (() => {
22
- const _el$ = web.getNextElement(_tmpl$);
23
- web.insert(_el$, () => month.label);
24
- web.effect(() => _el$.value = month.value);
25
- return _el$;
26
- })()
21
+ children: month => web.ssr(_tmpl$, web.ssrHydrationKey() + web.ssrAttribute("value", web.escape(month.value, true), false), web.escape(month.label))
27
22
  });
28
23
  }
29
24
  }));
@@ -1,10 +1,10 @@
1
- import { createComponent, mergeProps as mergeProps$1, getNextElement, insert, effect, template } from 'solid-js/web';
1
+ import { createComponent, mergeProps as mergeProps$1, ssr, ssrHydrationKey, ssrAttribute, escape } from 'solid-js/web';
2
2
  import { mergeProps } from '@zag-js/solid';
3
3
  import { For } from 'solid-js';
4
4
  import { ark } from '../factory.mjs';
5
5
  import { useDatePickerContext } from './date-picker-context.mjs';
6
6
 
7
- const _tmpl$ = /*#__PURE__*/template(`<option>`);
7
+ const _tmpl$ = ["<option", ">", "</option>"];
8
8
  const DatePickerMonthSelect = props => {
9
9
  const datePicker = useDatePickerContext();
10
10
  const mergedProps = mergeProps(() => datePicker().monthSelectProps, props);
@@ -14,12 +14,7 @@ const DatePickerMonthSelect = props => {
14
14
  get each() {
15
15
  return datePicker().getMonths();
16
16
  },
17
- children: month => (() => {
18
- const _el$ = getNextElement(_tmpl$);
19
- insert(_el$, () => month.label);
20
- effect(() => _el$.value = month.value);
21
- return _el$;
22
- })()
17
+ children: month => ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("value", escape(month.value, true), false), escape(month.label))
23
18
  });
24
19
  }
25
20
  }));
@@ -8,7 +8,7 @@ const solidJs = require('solid-js');
8
8
  const factory = require('../factory.cjs');
9
9
  const datePickerContext = require('./date-picker-context.cjs');
10
10
 
11
- const _tmpl$ = /*#__PURE__*/web.template(`<option>`);
11
+ const _tmpl$ = ["<option", ">", "</option>"];
12
12
  const DatePickerYearSelect = props => {
13
13
  const datePicker = datePickerContext.useDatePickerContext();
14
14
  const mergedProps = solid.mergeProps(() => datePicker().yearSelectProps, props);
@@ -21,12 +21,7 @@ const DatePickerYearSelect = props => {
21
21
  to: 4_000
22
22
  });
23
23
  },
24
- children: year => (() => {
25
- const _el$ = web.getNextElement(_tmpl$);
26
- _el$.value = year;
27
- web.insert(_el$, year);
28
- return _el$;
29
- })()
24
+ children: year => web.ssr(_tmpl$, web.ssrHydrationKey() + web.ssrAttribute("value", web.escape(year, true), false), web.escape(year))
30
25
  });
31
26
  }
32
27
  }));
@@ -1,10 +1,10 @@
1
- import { createComponent, mergeProps as mergeProps$1, getNextElement, insert, template } from 'solid-js/web';
1
+ import { createComponent, mergeProps as mergeProps$1, ssr, ssrHydrationKey, ssrAttribute, escape } from 'solid-js/web';
2
2
  import { mergeProps } from '@zag-js/solid';
3
3
  import { For } from 'solid-js';
4
4
  import { ark } from '../factory.mjs';
5
5
  import { useDatePickerContext } from './date-picker-context.mjs';
6
6
 
7
- const _tmpl$ = /*#__PURE__*/template(`<option>`);
7
+ const _tmpl$ = ["<option", ">", "</option>"];
8
8
  const DatePickerYearSelect = props => {
9
9
  const datePicker = useDatePickerContext();
10
10
  const mergedProps = mergeProps(() => datePicker().yearSelectProps, props);
@@ -17,12 +17,7 @@ const DatePickerYearSelect = props => {
17
17
  to: 4_000
18
18
  });
19
19
  },
20
- children: year => (() => {
21
- const _el$ = getNextElement(_tmpl$);
22
- _el$.value = year;
23
- insert(_el$, year);
24
- return _el$;
25
- })()
20
+ children: year => ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("value", escape(year, true), false), escape(year))
26
21
  });
27
22
  }
28
23
  }));
@@ -6,7 +6,7 @@ const web = require('solid-js/web');
6
6
  const solidJs = require('solid-js');
7
7
  const environmentContext = require('./environment-context.cjs');
8
8
 
9
- const _tmpl$ = /*#__PURE__*/web.template(`<span hidden>`);
9
+ const _tmpl$ = ["<span", " hidden></span>"];
10
10
  const Environment = props => {
11
11
  // eslint-disable-next-line prefer-const
12
12
  let spanRef = undefined;
@@ -16,12 +16,7 @@ const Environment = props => {
16
16
  return currentEnv();
17
17
  },
18
18
  get children() {
19
- return [web.memo(() => props.children), web.memo(() => web.memo(() => !!!props.value)() && (() => {
20
- const _el$ = web.getNextElement(_tmpl$);
21
- const _ref$ = spanRef;
22
- typeof _ref$ === "function" ? web.use(_ref$, _el$) : spanRef = _el$;
23
- return _el$;
24
- })())];
19
+ return [props.children, !props.value && web.ssr(_tmpl$, web.ssrHydrationKey())];
25
20
  }
26
21
  });
27
22
  };
@@ -1,8 +1,8 @@
1
- import { createComponent, memo, getNextElement, use, template } from 'solid-js/web';
1
+ import { createComponent, ssr, ssrHydrationKey } from 'solid-js/web';
2
2
  import { createMemo } from 'solid-js';
3
3
  import { EnvironmentProvider } from './environment-context.mjs';
4
4
 
5
- const _tmpl$ = /*#__PURE__*/template(`<span hidden>`);
5
+ const _tmpl$ = ["<span", " hidden></span>"];
6
6
  const Environment = props => {
7
7
  // eslint-disable-next-line prefer-const
8
8
  let spanRef = undefined;
@@ -12,12 +12,7 @@ const Environment = props => {
12
12
  return currentEnv();
13
13
  },
14
14
  get children() {
15
- return [memo(() => props.children), memo(() => memo(() => !!!props.value)() && (() => {
16
- const _el$ = getNextElement(_tmpl$);
17
- const _ref$ = spanRef;
18
- typeof _ref$ === "function" ? use(_ref$, _el$) : spanRef = _el$;
19
- return _el$;
20
- })())];
15
+ return [props.children, !props.value && ssr(_tmpl$, ssrHydrationKey())];
21
16
  }
22
17
  });
23
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ark-ui/solid",
3
- "version": "0.7.2-beta.3",
3
+ "version": "0.7.2-beta.5",
4
4
  "description": "A collection of unstyled, accessible UI components for Solid, utilizing state machines for seamless interaction.",
5
5
  "keywords": [
6
6
  "accordion",
@@ -33,7 +33,6 @@
33
33
  "toast",
34
34
  "tooltip"
35
35
  ],
36
- "type": "module",
37
36
  "homepage": "https://ark-ui.com",
38
37
  "license": "MIT",
39
38
  "sideEffects": false,
@@ -8,19 +8,13 @@ const solidJs = require('solid-js');
8
8
  const factory = require('../factory.cjs');
9
9
  const pinInputContext = require('./pin-input-context.cjs');
10
10
 
11
- const _tmpl$ = /*#__PURE__*/web.template(`<input>`);
12
11
  const PinInputControl = props => {
13
12
  const api = pinInputContext.usePinInputContext();
14
13
  const [childrenProps, restProps] = solidJs.splitProps(props, ['children']);
15
14
  const controlProps = solid.mergeProps(() => api().controlProps, restProps);
16
15
  return web.createComponent(factory.ark.div, web.mergeProps(controlProps, {
17
16
  get children() {
18
- return [web.memo(() => childrenProps.children), (() => {
19
- const _el$ = web.getNextElement(_tmpl$);
20
- web.spread(_el$, web.mergeProps(() => api().hiddenInputProps), false, false);
21
- web.runHydrationEvents();
22
- return _el$;
23
- })()];
17
+ return [childrenProps.children, web.ssrElement("input", api().hiddenInputProps, undefined, true)];
24
18
  }
25
19
  }));
26
20
  };
@@ -1,22 +1,16 @@
1
- import { createComponent, mergeProps as mergeProps$1, memo, getNextElement, spread, runHydrationEvents, template } from 'solid-js/web';
1
+ import { createComponent, mergeProps as mergeProps$1, ssrElement } from 'solid-js/web';
2
2
  import { mergeProps } from '@zag-js/solid';
3
3
  import { splitProps } from 'solid-js';
4
4
  import { ark } from '../factory.mjs';
5
5
  import { usePinInputContext } from './pin-input-context.mjs';
6
6
 
7
- const _tmpl$ = /*#__PURE__*/template(`<input>`);
8
7
  const PinInputControl = props => {
9
8
  const api = usePinInputContext();
10
9
  const [childrenProps, restProps] = splitProps(props, ['children']);
11
10
  const controlProps = mergeProps(() => api().controlProps, restProps);
12
11
  return createComponent(ark.div, mergeProps$1(controlProps, {
13
12
  get children() {
14
- return [memo(() => childrenProps.children), (() => {
15
- const _el$ = getNextElement(_tmpl$);
16
- spread(_el$, mergeProps$1(() => api().hiddenInputProps), false, false);
17
- runHydrationEvents();
18
- return _el$;
19
- })()];
13
+ return [childrenProps.children, ssrElement("input", api().hiddenInputProps, undefined, true)];
20
14
  }
21
15
  }));
22
16
  };
@@ -18,7 +18,7 @@ const RatingGroup = props => {
18
18
  get children() {
19
19
  return web.createComponent(factory.ark.div, web.mergeProps(rootProps, {
20
20
  get children() {
21
- return [web.memo(() => restProps.children), web.createComponent(factory.ark.input, web.mergeProps(() => api().hiddenInputProps))];
21
+ return [restProps.children, web.createComponent(factory.ark.input, web.mergeProps(() => api().hiddenInputProps))];
22
22
  }
23
23
  }));
24
24
  }
@@ -1,4 +1,4 @@
1
- import { createComponent, mergeProps as mergeProps$1, memo } from 'solid-js/web';
1
+ import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
2
2
  import { mergeProps } from '@zag-js/solid';
3
3
  import { createSplitProps } from '../create-split-props.mjs';
4
4
  import { ark } from '../factory.mjs';
@@ -14,7 +14,7 @@ const RatingGroup = props => {
14
14
  get children() {
15
15
  return createComponent(ark.div, mergeProps$1(rootProps, {
16
16
  get children() {
17
- return [memo(() => restProps.children), createComponent(ark.input, mergeProps$1(() => api().hiddenInputProps))];
17
+ return [restProps.children, createComponent(ark.input, mergeProps$1(() => api().hiddenInputProps))];
18
18
  }
19
19
  }));
20
20
  }
@@ -12,7 +12,7 @@ const SliderThumb = props => {
12
12
  const thumbProps = solid.mergeProps(() => api().thumbProps, props);
13
13
  return web.createComponent(factory.ark.div, web.mergeProps(thumbProps, {
14
14
  get children() {
15
- return [web.createComponent(factory.ark.input, web.mergeProps(() => api().hiddenInputProps)), web.memo(() => props.children)];
15
+ return [web.createComponent(factory.ark.input, web.mergeProps(() => api().hiddenInputProps)), props.children];
16
16
  }
17
17
  }));
18
18
  };
@@ -1,4 +1,4 @@
1
- import { createComponent, mergeProps as mergeProps$1, memo } from 'solid-js/web';
1
+ import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
2
2
  import { mergeProps } from '@zag-js/solid';
3
3
  import { ark } from '../factory.mjs';
4
4
  import { useSliderContext } from './slider-context.mjs';
@@ -8,7 +8,7 @@ const SliderThumb = props => {
8
8
  const thumbProps = mergeProps(() => api().thumbProps, props);
9
9
  return createComponent(ark.div, mergeProps$1(thumbProps, {
10
10
  get children() {
11
- return [createComponent(ark.input, mergeProps$1(() => api().hiddenInputProps)), memo(() => props.children)];
11
+ return [createComponent(ark.input, mergeProps$1(() => api().hiddenInputProps)), props.children];
12
12
  }
13
13
  }));
14
14
  };
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const web = require('solid-js/web');
6
5
  const solidJs = require('solid-js');
7
6
  const runIfFn = require('../run-if-fn.cjs');
8
7
  const toastProvider = require('./toast-provider.cjs');
@@ -11,7 +10,7 @@ const ToastPlacements = props => {
11
10
  const toast = toastProvider.useToast();
12
11
  const placements = solidJs.createMemo(() => Object.keys(toast().toastsByPlacement));
13
12
  const getChildren = () => runIfFn.runIfFn(props.children, placements);
14
- return web.memo(getChildren);
13
+ return getChildren();
15
14
  };
16
15
 
17
16
  exports.ToastPlacements = ToastPlacements;
@@ -1,4 +1,3 @@
1
- import { memo } from 'solid-js/web';
2
1
  import { createMemo } from 'solid-js';
3
2
  import { runIfFn } from '../run-if-fn.mjs';
4
3
  import { useToast } from './toast-provider.mjs';
@@ -7,7 +6,7 @@ const ToastPlacements = props => {
7
6
  const toast = useToast();
8
7
  const placements = createMemo(() => Object.keys(toast().toastsByPlacement));
9
8
  const getChildren = () => runIfFn(props.children, placements);
10
- return memo(getChildren);
9
+ return getChildren();
11
10
  };
12
11
 
13
12
  export { ToastPlacements };