@elmethis/react 0.22.0 → 0.24.1
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/README.md +10 -11
- package/lib/fixtures/advanced-rag-pipeline.html +1 -1
- package/lib/index.react.cjs +5 -5
- package/lib/index.react.mjs +741 -727
- package/lib/style.css +1 -1
- package/lib-types/components/a2ui/catalog/catalog-utils.d.ts.map +1 -1
- package/lib-types/components/a2ui/catalog/notion-block-catalog.d.ts.map +1 -1
- package/lib-types/components/a2ui/elm-a2ui.d.ts.map +1 -1
- package/lib-types/components/a2ui/stream-json-lines.d.ts.map +1 -1
- package/lib-types/components/code/elm-html-viewer.d.ts.map +1 -1
- package/lib-types/components/code/elm-html.d.ts.map +1 -1
- package/lib-types/components/code/elm-shiki-highlighter.d.ts.map +1 -1
- package/lib-types/components/containments/elm-modal.d.ts.map +1 -1
- package/lib-types/components/containments/elm-parallax.d.ts.map +1 -1
- package/lib-types/components/containments/elm-toggle.d.ts +1 -2
- package/lib-types/components/containments/elm-toggle.d.ts.map +1 -1
- package/lib-types/components/containments/elm-tooltip.d.ts +2 -2
- package/lib-types/components/containments/elm-tooltip.d.ts.map +1 -1
- package/lib-types/components/form/elm-button-dropdown.d.ts.map +1 -1
- package/lib-types/components/form/elm-select.d.ts.map +1 -1
- package/lib-types/components/form/elm-slider.d.ts.map +1 -1
- package/lib-types/components/form/elm-text-field.d.ts.map +1 -1
- package/lib-types/components/icon/elm-language-icon.d.ts +2 -3
- package/lib-types/components/icon/elm-language-icon.d.ts.map +1 -1
- package/lib-types/components/icon/language-glyph.d.ts.map +1 -1
- package/lib-types/components/media/elm-audio-player.d.ts.map +1 -1
- package/lib-types/components/media/elm-file.d.ts.map +1 -1
- package/lib-types/components/others/elm-color-primitive-sample.d.ts.map +1 -1
- package/lib-types/components/others/elm-color-semantic-sample.d.ts.map +1 -1
- package/lib-types/components/others/elm-markdown.d.ts.map +1 -1
- package/lib-types/components/others/use-wordle.d.ts.map +1 -1
- package/lib-types/components/table/elm-table-cell.d.ts.map +1 -1
- package/lib-types/components/table/elm-table.d.ts.map +1 -1
- package/lib-types/components/typography/elm-heading.d.ts.map +1 -1
- package/lib-types/components/typography/elm-inline-text.d.ts.map +1 -1
- package/lib-types/hooks/use-async-state.d.ts.map +1 -1
- package/lib-types/hooks/use-auto-animate.d.ts +1 -2
- package/lib-types/hooks/use-auto-animate.d.ts.map +1 -1
- package/lib-types/hooks/use-bindable-signal.d.ts +2 -4
- package/lib-types/hooks/use-bindable-signal.d.ts.map +1 -1
- package/lib-types/hooks/use-bindable-store.d.ts +1 -3
- package/lib-types/hooks/use-bindable-store.d.ts.map +1 -1
- package/lib-types/hooks/use-clipboard.d.ts +2 -2
- package/lib-types/hooks/use-clipboard.d.ts.map +1 -1
- package/lib-types/hooks/use-debounced-signal.d.ts +3 -6
- package/lib-types/hooks/use-debounced-signal.d.ts.map +1 -1
- package/lib-types/hooks/use-debounced-store.d.ts +3 -5
- package/lib-types/hooks/use-debounced-store.d.ts.map +1 -1
- package/lib-types/hooks/use-delayed-signal.d.ts +1 -2
- package/lib-types/hooks/use-delayed-signal.d.ts.map +1 -1
- package/lib-types/hooks/use-elmethis-theme.d.ts +15 -5
- package/lib-types/hooks/use-elmethis-theme.d.ts.map +1 -1
- package/lib-types/hooks/use-storage.d.ts +2 -5
- package/lib-types/hooks/use-storage.d.ts.map +1 -1
- package/lib-types/hooks/use-throttled-queue.d.ts +2 -6
- package/lib-types/hooks/use-throttled-queue.d.ts.map +1 -1
- package/lib-types/hooks/use-throttled-signal.d.ts +3 -5
- package/lib-types/hooks/use-throttled-signal.d.ts.map +1 -1
- package/lib-types/hooks/use-throttled-store.d.ts +3 -7
- package/lib-types/hooks/use-throttled-store.d.ts.map +1 -1
- package/lib-types/index.d.ts.map +1 -1
- package/package.json +45 -46
- package/lib-types/components/a2ui/catalog/block-catalog.d.ts +0 -18
- package/lib-types/components/a2ui/catalog/block-catalog.d.ts.map +0 -1
- package/lib-types/components/form/elm-select-button.d.ts +0 -90
- package/lib-types/components/form/elm-select-button.d.ts.map +0 -1
- package/lib-types/components/icon/elm-iconify-icon.d.ts +0 -39
- package/lib-types/components/icon/elm-iconify-icon.d.ts.map +0 -1
- package/lib-types/components/icon/languages/bash.d.ts +0 -3
- package/lib-types/components/icon/languages/bash.d.ts.map +0 -1
- package/lib-types/components/icon/languages/c-plus-plus.d.ts +0 -3
- package/lib-types/components/icon/languages/c-plus-plus.d.ts.map +0 -1
- package/lib-types/components/icon/languages/c-sharp.d.ts +0 -3
- package/lib-types/components/icon/languages/c-sharp.d.ts.map +0 -1
- package/lib-types/components/icon/languages/c.d.ts +0 -3
- package/lib-types/components/icon/languages/c.d.ts.map +0 -1
- package/lib-types/components/icon/languages/css.d.ts +0 -3
- package/lib-types/components/icon/languages/css.d.ts.map +0 -1
- package/lib-types/components/icon/languages/go.d.ts +0 -3
- package/lib-types/components/icon/languages/go.d.ts.map +0 -1
- package/lib-types/components/icon/languages/html.d.ts +0 -3
- package/lib-types/components/icon/languages/html.d.ts.map +0 -1
- package/lib-types/components/icon/languages/java.d.ts +0 -3
- package/lib-types/components/icon/languages/java.d.ts.map +0 -1
- package/lib-types/components/icon/languages/javascript.d.ts +0 -3
- package/lib-types/components/icon/languages/javascript.d.ts.map +0 -1
- package/lib-types/components/icon/languages/json.d.ts +0 -3
- package/lib-types/components/icon/languages/json.d.ts.map +0 -1
- package/lib-types/components/icon/languages/kotlin.d.ts +0 -3
- package/lib-types/components/icon/languages/kotlin.d.ts.map +0 -1
- package/lib-types/components/icon/languages/language-interface.d.ts +0 -7
- package/lib-types/components/icon/languages/language-interface.d.ts.map +0 -1
- package/lib-types/components/icon/languages/lua.d.ts +0 -3
- package/lib-types/components/icon/languages/lua.d.ts.map +0 -1
- package/lib-types/components/icon/languages/npm.d.ts +0 -3
- package/lib-types/components/icon/languages/npm.d.ts.map +0 -1
- package/lib-types/components/icon/languages/python.d.ts +0 -3
- package/lib-types/components/icon/languages/python.d.ts.map +0 -1
- package/lib-types/components/icon/languages/rust.d.ts +0 -3
- package/lib-types/components/icon/languages/rust.d.ts.map +0 -1
- package/lib-types/components/icon/languages/sql.d.ts +0 -3
- package/lib-types/components/icon/languages/sql.d.ts.map +0 -1
- package/lib-types/components/icon/languages/terraform.d.ts +0 -3
- package/lib-types/components/icon/languages/terraform.d.ts.map +0 -1
- package/lib-types/components/icon/languages/typescript.d.ts +0 -3
- package/lib-types/components/icon/languages/typescript.d.ts.map +0 -1
- package/lib-types/components/icon/mdi-bundle.d.ts +0 -3
- package/lib-types/components/icon/mdi-bundle.d.ts.map +0 -1
- package/lib-types/components/others/elm-html-viewer.d.ts +0 -13
- package/lib-types/components/others/elm-html-viewer.d.ts.map +0 -1
- package/lib-types/components/others/elm-html.d.ts +0 -13
- package/lib-types/components/others/elm-html.d.ts.map +0 -1
- package/lib-types/components/others/elm-jarkup.d.ts +0 -8
- package/lib-types/components/others/elm-jarkup.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elm-heading.d.ts","sourceRoot":"","sources":["../../../src/components/typography/elm-heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAiB,MAAM,OAAO,CAAC;AAOrE,MAAM,WAAW,eAAgB,SAAQ,wBAAwB,CAAC,IAAI,CAAC;IACrE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"elm-heading.d.ts","sourceRoot":"","sources":["../../../src/components/typography/elm-heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAiB,MAAM,OAAO,CAAC;AAOrE,MAAM,WAAW,eAAgB,SAAQ,wBAAwB,CAAC,IAAI,CAAC;IACrE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAaD,eAAO,MAAM,UAAU,GAAI,2DAQxB,eAAe,gCAgCjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elm-inline-text.d.ts","sourceRoot":"","sources":["../../../src/components/typography/elm-inline-text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAQhF,MAAM,WAAW,kBAAmB,SAAQ,wBAAwB,CAAC,MAAM,CAAC;IAC1E;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAE/B;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAEjC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAEnD;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,GAAI,+IAiB3B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"elm-inline-text.d.ts","sourceRoot":"","sources":["../../../src/components/typography/elm-inline-text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa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C3F,OAAO,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,KAAK,EAAE,OAAO,CAAC;IACf,2EAA2E;IAC3E,OAAO,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;CAC5D;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,GAAI,IAAI,EAChC,SAAS,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,cAAc,IAAI,EAClB,UAAU,oBAAoB,CAAC,IAAI,CAAC,KACnC,mBAAmB,CAAC,IAAI,CA+F1B,CAAC"}
|
|
@@ -10,8 +10,7 @@ export type UseAutoAnimateOptions = {
|
|
|
10
10
|
*
|
|
11
11
|
* @see {@link https://auto-animate.formkit.com/|Auto Animate} for more information.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
* signals), this React port returns the `[ref, setEnabled]` shape exposed by
|
|
13
|
+
* This hook returns the `[ref, setEnabled]` shape exposed by
|
|
15
14
|
* `@formkit/auto-animate/react`, mapped onto a `{ ref, setEnabled }` object:
|
|
16
15
|
* spread `ref` onto the container element, and call `setEnabled(boolean)` to
|
|
17
16
|
* toggle the animation controller on or off.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-auto-animate.d.ts","sourceRoot":"","sources":["../../src/hooks/use-auto-animate.tsx"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"use-auto-animate.d.ts","sourceRoot":"","sources":["../../src/hooks/use-auto-animate.tsx"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EAChE,UAAU,qBAAqB;;;CAKhC,CAAC"}
|
|
@@ -2,10 +2,8 @@ import type { Dispatch, SetStateAction } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* Optionally-controllable single-value state.
|
|
4
4
|
*
|
|
5
|
-
* React
|
|
6
|
-
*
|
|
7
|
-
* `.value`), the React idiom returns a `[value, setValue]` tuple. The
|
|
8
|
-
* underlying controllable-vs-internal behavior is preserved:
|
|
5
|
+
* The React API returns a `[value, setValue]` tuple and supports controlled and
|
|
6
|
+
* uncontrolled state:
|
|
9
7
|
*
|
|
10
8
|
* - **Controlled:** parent passes their own `value`. The hook returns that
|
|
11
9
|
* value — calling `setValue` invokes the parent's `onChange` so the parent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-bindable-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-bindable-signal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"use-bindable-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-bindable-signal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,EACnC,KAAK,EACL,YAAY,EACZ,QAAQ,GACT,EAAE;IACD,+EAA+E;IAC/E,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,8DAA8D;IAC9D,YAAY,EAAE,CAAC,CAAC;IAChB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAOnC"}
|
|
@@ -11,9 +11,7 @@ import * as React from "react";
|
|
|
11
11
|
* Use this when the controllable state is a struct (form values, multi-field
|
|
12
12
|
* UI state). For a single primitive value, prefer `useBindableSignal`.
|
|
13
13
|
*
|
|
14
|
-
* React
|
|
15
|
-
* so callers mutate nested properties in place (`form.name = "Alice"`). React
|
|
16
|
-
* has no such reactive proxy, so this port returns the
|
|
14
|
+
* React state is immutable, so this hook returns the
|
|
17
15
|
* `[value, setValue]` tuple from `@radix-ui/react-use-controllable-state`
|
|
18
16
|
* instead. To update a field, set a fresh object:
|
|
19
17
|
* `setValue((prev) => ({ ...prev, name: "Alice" }))`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-bindable-store.d.ts","sourceRoot":"","sources":["../../src/hooks/use-bindable-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B
|
|
1
|
+
{"version":3,"file":"use-bindable-store.d.ts","sourceRoot":"","sources":["../../src/hooks/use-bindable-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,EACjD,KAAK,EACL,YAAY,EACZ,QAAQ,GACT,EAAE;IACD,+EAA+E;IAC/E,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,yDAAyD;IACzD,YAAY,EAAE,CAAC,CAAC;IAChB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAO/C"}
|
|
@@ -7,8 +7,8 @@ export interface UseClipboardOptions {
|
|
|
7
7
|
delay?: number;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Returns a `copy` callback and a `CopyButton` component whose icon swaps to
|
|
11
|
+
* the check variant for `delay`
|
|
12
12
|
* ms after a successful copy.
|
|
13
13
|
*
|
|
14
14
|
* Text content is written via usehooks-ts `useCopyToClipboard`; rich
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-clipboard.d.ts","sourceRoot":"","sources":["../../src/hooks/use-clipboard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAS3C,KAAK,sBAAsB,GAAG,qBAAqB,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7E,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB,OAAO,EAAE,MAAM,GAAG,sBAAsB,EAAE,CAAC;IAE3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,mBAAmB;;;
|
|
1
|
+
{"version":3,"file":"use-clipboard.d.ts","sourceRoot":"","sources":["../../src/hooks/use-clipboard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAS3C,KAAK,sBAAsB,GAAG,qBAAqB,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7E,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB,OAAO,EAAE,MAAM,GAAG,sBAAsB,EAAE,CAAC;IAE3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,mBAAmB;;;CAuExD,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* React shape returned by {@link useDebouncedSignal}.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
* as a `useState`-style tuple object: `value` + `setValue` replace the
|
|
7
|
-
* read/write `signal`, `debouncedValue` replaces the read-only
|
|
8
|
-
* `debouncedSignal`, and `isPending` is a plain boolean.
|
|
4
|
+
* Exposed as a `useState`-style object: `value` + `setValue` hold the immediate
|
|
5
|
+
* value, `debouncedValue` is read-only, and `isPending` is a plain boolean.
|
|
9
6
|
*/
|
|
10
7
|
export interface UseDebouncedSignalReturn<T> {
|
|
11
8
|
/** The current value. Reflects every write to `setValue` immediately. */
|
|
12
9
|
value: T;
|
|
13
|
-
/** Writes a new value
|
|
10
|
+
/** Writes a new value or applies an updater. */
|
|
14
11
|
setValue: React.Dispatch<React.SetStateAction<T>>;
|
|
15
12
|
/**
|
|
16
13
|
* The debounced value. Reflects `value` only after `delay` ms have elapsed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-debounced-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-debounced-signal.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"use-debounced-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-debounced-signal.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,yEAAyE;IACzE,KAAK,EAAE,CAAC,CAAC;IACT,gDAAgD;IAChD,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD;;;;OAIG;IACH,cAAc,EAAE,CAAC,CAAC;IAClB,2EAA2E;IAC3E,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAClC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAC3B,OAAO,MAAM,KACZ,wBAAwB,CAAC,CAAC,CAmC5B,CAAC"}
|
|
@@ -2,14 +2,12 @@ import type { Dispatch, SetStateAction } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns a store pair with debounced reactivity.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* exist in React, so where qwik returned a deep-reactive proxy pair plus an
|
|
7
|
-
* `isPending` signal, this hook returns plain React state:
|
|
5
|
+
* This hook returns plain React state:
|
|
8
6
|
*
|
|
9
7
|
* - `store` — the current value, reflecting every write immediately.
|
|
10
8
|
* - `setStore` — the setter for `store` (accepts a value or an updater fn,
|
|
11
|
-
* exactly like a `useState` setter).
|
|
12
|
-
*
|
|
9
|
+
* exactly like a `useState` setter), e.g.
|
|
10
|
+
* `setStore((s) => ({ ...s, query: next }))`.
|
|
13
11
|
* - `debouncedStore` — receives the same state only after `delay` ms have
|
|
14
12
|
* elapsed since the last write to `store`. Rapid successive writes reset the
|
|
15
13
|
* timer so only the final state propagates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-debounced-store.d.ts","sourceRoot":"","sources":["../../src/hooks/use-debounced-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAOtD
|
|
1
|
+
{"version":3,"file":"use-debounced-store.d.ts","sourceRoot":"","sources":["../../src/hooks/use-debounced-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAOtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAChD,YAAY,EAAE,CAAC,EACf,KAAK,EAAE,MAAM,GACZ;IACD,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,cAAc,EAAE,CAAC,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB,CAkCA"}
|
|
@@ -27,8 +27,7 @@ export interface UseDelayedSignalReturn<T> {
|
|
|
27
27
|
*
|
|
28
28
|
* `isValueChanging` is `true` while a timer is pending.
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
* trio of signals), this React port returns plain reactive values via
|
|
30
|
+
* Returns plain reactive values via
|
|
32
31
|
* `{ value, delayedValue, isValueChanging, dispatch }`.
|
|
33
32
|
*
|
|
34
33
|
* @param initialValue - Seed value for both `value` and `delayedValue`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-delayed-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-delayed-signal.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,iDAAiD;IACjD,KAAK,EAAE,CAAC,CAAC;IACT,yEAAyE;IACzE,YAAY,EAAE,CAAC,CAAC;IAChB,uCAAuC;IACvC,eAAe,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED
|
|
1
|
+
{"version":3,"file":"use-delayed-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-delayed-signal.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,iDAAiD;IACjD,KAAK,EAAE,CAAC,CAAC;IACT,yEAAyE;IACzE,YAAY,EAAE,CAAC,CAAC;IAChB,uCAAuC;IACvC,eAAe,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAChC,cAAc,CAAC,KACd,sBAAsB,CAAC,CAAC,CA0C1B,CAAC"}
|
|
@@ -3,24 +3,34 @@
|
|
|
3
3
|
* theme mutation. Each `useElmethisTheme()` call owns an independent piece of
|
|
4
4
|
* state, and the `storage` event only fires in *other* tabs — so without this
|
|
5
5
|
* event, sibling components in the same tab would never see a toggle.
|
|
6
|
-
* `detail` carries the new `Theme | null` (`null` =
|
|
6
|
+
* `detail` carries the new `Theme | null` (`null` = inline pin removed).
|
|
7
7
|
*/
|
|
8
8
|
export declare const THEME_CHANGE_EVENT = "elmethis-theme-change";
|
|
9
9
|
type Theme = "light" | "dark";
|
|
10
10
|
/**
|
|
11
11
|
* Coerce a raw storage value into an explicit Theme, or `null` when no
|
|
12
|
-
* explicit choice is stored.
|
|
13
|
-
*
|
|
14
|
-
* `prefers-color-scheme`.
|
|
12
|
+
* explicit choice is stored. Without a stored choice, the host's computed
|
|
13
|
+
* `color-scheme` wins; the `light dark` default tracks `prefers-color-scheme`.
|
|
15
14
|
*
|
|
16
15
|
* Exported so the (otherwise inline) decision rule can be regression-tested
|
|
17
16
|
* directly without having to dispatch a real `StorageEvent`.
|
|
18
17
|
*
|
|
19
18
|
* Only the literal strings `"dark"` and `"light"` are explicit choices;
|
|
20
19
|
* anything else — including `null` (the key was cleared in another tab) and
|
|
21
|
-
* unknown strings — resolves to `null` (
|
|
20
|
+
* unknown strings — resolves to `null` (no stored override).
|
|
22
21
|
*/
|
|
23
22
|
export declare const parseTheme: (raw: string | null) => Theme | null;
|
|
23
|
+
/**
|
|
24
|
+
* Pin or release the Elmethis theme natively via `color-scheme` + `data-theme`
|
|
25
|
+
* on `<html>`, with cross-tab (`storage`) and same-tab (`CustomEvent`) sync.
|
|
26
|
+
*
|
|
27
|
+
* The React API returns the plain idiom: `isDarkTheme` is a `boolean` and
|
|
28
|
+
* `toggleTheme` is a `() => void`.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const { isDarkTheme, toggleTheme } = useElmethisTheme();
|
|
32
|
+
* return <button onClick={toggleTheme}>{isDarkTheme ? "🌙" : "☀️"}</button>;
|
|
33
|
+
*/
|
|
24
34
|
export declare function useElmethisTheme(): {
|
|
25
35
|
isDarkTheme: boolean;
|
|
26
36
|
toggleTheme: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-elmethis-theme.d.ts","sourceRoot":"","sources":["../../src/hooks/use-elmethis-theme.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"use-elmethis-theme.d.ts","sourceRoot":"","sources":["../../src/hooks/use-elmethis-theme.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,GAAG,IAAI,KAAG,KAAK,GAAG,IACI,CAAC;AAmE7D;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB;;;EAqE/B"}
|
|
@@ -16,13 +16,10 @@ export type UseStorageReturn<T> = {
|
|
|
16
16
|
/**
|
|
17
17
|
* Persisted, cross-tab-synced state backed by `localStorage` / `sessionStorage`.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* React, so where qwik returned `{ state, remove }` with `state` as a
|
|
21
|
-
* read/write `Signal<T>`, this returns `{ state, setState, remove }` — read
|
|
19
|
+
* Returns `{ state, setState, remove }`: read
|
|
22
20
|
* `state`, write with `setState(next)`, clear with `remove()`.
|
|
23
21
|
*
|
|
24
|
-
* Reads happen only on the client
|
|
25
|
-
* `useVisibleTask$({ strategy: "document-ready" })`. Cross-tab sync uses the
|
|
22
|
+
* Reads happen only on the client after mount. Cross-tab sync uses the
|
|
26
23
|
* native `storage` event for `localStorage`; `sessionStorage` (which does not
|
|
27
24
|
* emit `storage` across tabs) syncs via a `BroadcastChannel`. The channel is
|
|
28
25
|
* allocated once per mount and reused for every write/remove.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-storage.d.ts","sourceRoot":"","sources":["../../src/hooks/use-storage.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IACjC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,CAAC,CAAC;IAChB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,yFAAyF;IACzF,KAAK,EAAE,CAAC,CAAC;IACT,6DAA6D;IAC7D,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,wEAAwE;IACxE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAKF
|
|
1
|
+
{"version":3,"file":"use-storage.d.ts","sourceRoot":"","sources":["../../src/hooks/use-storage.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IACjC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,CAAC,CAAC;IAChB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,yFAAyF;IACzF,KAAK,EAAE,CAAC,CAAC;IACT,6DAA6D;IAC7D,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,wEAAwE;IACxE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAKF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,8CAK3B,iBAAiB,CAAC,CAAC,CAAC,KAAG,gBAAgB,CAAC,CAAC,CAgH3C,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI,IAAI,CAC1C,iBAAiB,CAAC,CAAC,CAAC,EACpB,aAAa,CACd,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,wBAGhC,sBAAsB,CAAC,CAAC,CAAC,KAAG,gBAAgB,CAAC,CAAC,CAMhD,CAAC;AAEF,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI,IAAI,CAC5C,iBAAiB,CAAC,CAAC,CAAC,EACpB,aAAa,CACd,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,wBAGlC,wBAAwB,CAAC,CAAC,CAAC,KAAG,gBAAgB,CAAC,CAAC,CAOlD,CAAC"}
|
|
@@ -14,12 +14,8 @@ export declare class ThrottledQueue {
|
|
|
14
14
|
/**
|
|
15
15
|
* Client-side throttled task queue.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
* `
|
|
19
|
-
* `useVisibleTask$`. React has no signal/serialization model, so the queue is
|
|
20
|
-
* held in a ref and created on mount via `useEffect` (which, like
|
|
21
|
-
* `useVisibleTask$`, only runs on the client). The hook returns the
|
|
22
|
-
* `ThrottledQueue` instance directly.
|
|
17
|
+
* The queue is held in a ref and created on mount via `useEffect`, which only
|
|
18
|
+
* runs on the client. The hook returns the `ThrottledQueue` instance directly.
|
|
23
19
|
*
|
|
24
20
|
* The queue is created lazily on first client render and destroyed on unmount,
|
|
25
21
|
* rejecting any still-pending tasks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-throttled-queue.d.ts","sourceRoot":"","sources":["../../src/hooks/use-throttled-queue.tsx"],"names":[],"mappings":"AAIA,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,KAAK,CAA8C;IAC3D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,WAAW,SAAM;IAI7B,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"use-throttled-queue.d.ts","sourceRoot":"","sources":["../../src/hooks/use-throttled-queue.tsx"],"names":[],"mappings":"AAIA,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,KAAK,CAA8C;IAC3D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,WAAW,SAAM;IAI7B,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAwBzC,OAAO,CAAC,MAAM,SAA6B,GAAG,IAAI;IAgBlD,OAAO,CAAC,KAAK;IAQb,OAAO,CAAC,YAAY;CAkBrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,SAAM,GAAG,cAAc,GAAG,IAAI,CA0B1E"}
|
|
@@ -13,11 +13,9 @@ export interface UseThrottledSignalReturn<T> {
|
|
|
13
13
|
* Returns reactive state where writing to `value` drives a leading + trailing
|
|
14
14
|
* edge throttled update to `throttledValue`.
|
|
15
15
|
*
|
|
16
|
-
* React
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* `{ value, setValue, throttledValue, isCooling }` — `value`/`setValue` is the
|
|
20
|
-
* usual `useState` pair, `throttledValue` and `isCooling` are read-only.
|
|
16
|
+
* The React API returns `{ value, setValue, throttledValue, isCooling }`:
|
|
17
|
+
* `value`/`setValue` is the usual `useState` pair, while `throttledValue` and
|
|
18
|
+
* `isCooling` are read-only.
|
|
21
19
|
*
|
|
22
20
|
* `value` reflects every write immediately.
|
|
23
21
|
* `throttledValue` updates on the *leading edge* of each throttle window: the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-throttled-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-throttled-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,wCAAwC;IACxC,KAAK,EAAE,CAAC,CAAC;IACT,+DAA+D;IAC/D,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,yDAAyD;IACzD,cAAc,EAAE,CAAC,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,OAAO,CAAC;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"use-throttled-signal.d.ts","sourceRoot":"","sources":["../../src/hooks/use-throttled-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,wCAAwC;IACxC,KAAK,EAAE,CAAC,CAAC;IACT,+DAA+D;IAC/D,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,yDAAyD;IACzD,cAAc,EAAE,CAAC,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAClC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAC3B,UAAU,MAAM,KACf,wBAAwB,CAAC,CAAC,CAqE5B,CAAC"}
|
|
@@ -13,17 +13,13 @@ export interface UseThrottledStoreReturn<T extends object> {
|
|
|
13
13
|
* Returns reactive struct state where writing to `value` drives a leading +
|
|
14
14
|
* trailing edge throttled update to `throttledValue`.
|
|
15
15
|
*
|
|
16
|
-
* React
|
|
17
|
-
* deep-reactive `Proxy<T>` you mutate in place (`store.x = 1`) — does not exist
|
|
18
|
-
* in React. Where qwik returned a `{ store, throttledStore, isCooling }` trio of
|
|
19
|
-
* proxies, this port returns `{ value, setValue, throttledValue, isCooling }`:
|
|
16
|
+
* The React API returns `{ value, setValue, throttledValue, isCooling }`:
|
|
20
17
|
* `value`/`setValue` is the usual `useState` pair, `throttledValue` and
|
|
21
18
|
* `isCooling` are read-only. To update a field, set a fresh object:
|
|
22
19
|
* `setValue((prev) => ({ ...prev, name: "Alice" }))`.
|
|
23
20
|
*
|
|
24
|
-
* Because React state is immutable,
|
|
25
|
-
*
|
|
26
|
-
* required here — callers hand the hook fresh objects. Equality between the two
|
|
21
|
+
* Because React state is immutable, callers hand the hook fresh objects.
|
|
22
|
+
* Equality between the two
|
|
27
23
|
* stores is compared **structurally** (`es-toolkit` `isEqual`), so setting a
|
|
28
24
|
* fresh object that is deeply equal to the current `throttledValue` does not
|
|
29
25
|
* arm a throttle window.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-throttled-store.d.ts","sourceRoot":"","sources":["../../src/hooks/use-throttled-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAGf,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,MAAM;IACvD,wCAAwC;IACxC,KAAK,EAAE,CAAC,CAAC;IACT,+DAA+D;IAC/D,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,yDAAyD;IACzD,cAAc,EAAE,CAAC,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,OAAO,CAAC;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"use-throttled-store.d.ts","sourceRoot":"","sources":["../../src/hooks/use-throttled-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAGf,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,MAAM;IACvD,wCAAwC;IACxC,KAAK,EAAE,CAAC,CAAC;IACT,+DAA+D;IAC/D,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,yDAAyD;IACzD,cAAc,EAAE,CAAC,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,EAChD,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAC3B,UAAU,MAAM,KACf,uBAAuB,CAAC,CAAC,CAqE3B,CAAC"}
|
package/lib-types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAC;AAKnC,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EACL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M,kCAAkC,CAAC;AAC9E,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,GAC9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,gBAAgB,EAChB,KAAK,sBAAsB,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,EAC3B,iBAAiB,EACjB,KAAK,wBAAwB,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,GAC9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,iBAAiB,EACjB,KAAK,uBAAuB,GAC7B,MAAM,6BAA6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elmethis/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"description": "React component library for elmethis.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -37,65 +37,64 @@
|
|
|
37
37
|
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"react": "^19.
|
|
41
|
-
"react-dom": "^19.
|
|
40
|
+
"react": "^19.3.0",
|
|
41
|
+
"react-dom": "^19.3.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@46ki75/ikuma-theme": "^0.0.10",
|
|
45
|
-
"@a2ui/react": "^0.
|
|
46
|
-
"@a2ui/web_core": "^0.
|
|
45
|
+
"@a2ui/react": "^0.11.1",
|
|
46
|
+
"@a2ui/web_core": "^0.11.0",
|
|
47
47
|
"@formkit/auto-animate": "^0.10.0",
|
|
48
48
|
"@mdi/js": "^7.4.47",
|
|
49
|
-
"@radix-ui/react-use-controllable-state": "^1.2.
|
|
49
|
+
"@radix-ui/react-use-controllable-state": "^1.2.6",
|
|
50
50
|
"clsx": "^2.1.1",
|
|
51
|
-
"dompurify": "^3.4.
|
|
52
|
-
"es-toolkit": "^1.
|
|
53
|
-
"katex": "^0.18.
|
|
54
|
-
"marked": "^18.0.
|
|
55
|
-
"shiki": "^4.3
|
|
51
|
+
"dompurify": "^3.4.15",
|
|
52
|
+
"es-toolkit": "^1.52.0",
|
|
53
|
+
"katex": "^0.18.7",
|
|
54
|
+
"marked": "^18.0.13",
|
|
55
|
+
"shiki": "^4.4.3",
|
|
56
56
|
"usehooks-ts": "^3.1.1",
|
|
57
|
-
"zod": "^3",
|
|
58
|
-
"@elmethis/core": "^0.
|
|
57
|
+
"zod": "^3.25.76",
|
|
58
|
+
"@elmethis/core": "^0.24.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@babel/core": "^7.29.7",
|
|
62
62
|
"@eslint/js": "latest",
|
|
63
|
-
"@rolldown/plugin-babel": "^0.2.
|
|
64
|
-
"@storybook/addon-docs": "^10.
|
|
65
|
-
"@storybook/react-vite": "^10.
|
|
66
|
-
"@testing-library/jest-dom": "^7.0.
|
|
67
|
-
"@testing-library/react": "^16.3.
|
|
63
|
+
"@rolldown/plugin-babel": "^0.2.4",
|
|
64
|
+
"@storybook/addon-docs": "^10.6.0",
|
|
65
|
+
"@storybook/react-vite": "^10.6.0",
|
|
66
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
67
|
+
"@testing-library/react": "^16.3.3",
|
|
68
68
|
"@types/babel__core": "^7.20.5",
|
|
69
69
|
"@types/katex": "^0.16.8",
|
|
70
|
-
"@types/node": "^26.
|
|
71
|
-
"@types/react": "^19.
|
|
72
|
-
"@types/react-dom": "^19.
|
|
73
|
-
"@vitejs/plugin-react": "^6.
|
|
74
|
-
"@vitest/browser-playwright": "^
|
|
75
|
-
"@vitest/coverage-v8": "^
|
|
76
|
-
"@vitest/ui": "^
|
|
70
|
+
"@types/node": "^26.5.1",
|
|
71
|
+
"@types/react": "^19.3.0",
|
|
72
|
+
"@types/react-dom": "^19.3.0",
|
|
73
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
74
|
+
"@vitest/browser-playwright": "^5.0.1",
|
|
75
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
76
|
+
"@vitest/ui": "^5.0.1",
|
|
77
77
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
78
|
-
"concurrently": "^10.0.
|
|
79
|
-
"eslint": "
|
|
78
|
+
"concurrently": "^10.0.5",
|
|
79
|
+
"@vitest/eslint-plugin": "1.6.27",
|
|
80
|
+
"eslint": "^10.11.0",
|
|
80
81
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
81
|
-
"eslint-plugin-react-refresh": "^0.5.
|
|
82
|
-
"globals": "^17.
|
|
83
|
-
"happy-dom": "^20.
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"react
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"stylelint
|
|
91
|
-
"
|
|
92
|
-
"stylelint-value-no-unknown-custom-properties": "^6.1.1",
|
|
93
|
-
"tsx": "^4.23.1",
|
|
82
|
+
"eslint-plugin-react-refresh": "^0.5.7",
|
|
83
|
+
"globals": "^17.12.0",
|
|
84
|
+
"happy-dom": "^20.14.3",
|
|
85
|
+
"jiti": "2.7.0",
|
|
86
|
+
"playwright": "^1.63.0",
|
|
87
|
+
"prettier": "3.9.8",
|
|
88
|
+
"react": "^19.3.0",
|
|
89
|
+
"react-dom": "^19.3.0",
|
|
90
|
+
"storybook": "^10.6.0",
|
|
91
|
+
"stylelint": "^17.15.0",
|
|
92
|
+
"tsx": "^4.23.13",
|
|
94
93
|
"typescript": "~6.0.3",
|
|
95
|
-
"typescript-eslint": "^8.
|
|
96
|
-
"vite": "^8.0
|
|
97
|
-
"vitest": "^
|
|
98
|
-
"vitest-browser-react": "^2.
|
|
94
|
+
"typescript-eslint": "^8.70.0",
|
|
95
|
+
"vite": "^8.3.0",
|
|
96
|
+
"vitest": "^5.0.1",
|
|
97
|
+
"vitest-browser-react": "^2.3.0"
|
|
99
98
|
},
|
|
100
99
|
"scripts": {
|
|
101
100
|
"build": "pnpm run build.lib && pnpm run build.types",
|
|
@@ -106,7 +105,7 @@
|
|
|
106
105
|
"dev": "storybook dev -p 19221 --no-open",
|
|
107
106
|
"fmt": "prettier --write ./src",
|
|
108
107
|
"fmt.check": "prettier --check ./src",
|
|
109
|
-
"lint": "eslint \"src/**/*.ts*\"",
|
|
108
|
+
"lint": "eslint \"src/**/*.ts*\" eslint.config.ts --max-warnings=0",
|
|
110
109
|
"lint.css": "stylelint \"{src,.storybook}/**/*.css\"",
|
|
111
110
|
"test": "pnpm run test.unit && pnpm run test.browser",
|
|
112
111
|
"test.unit": "vitest --run",
|
|
@@ -116,6 +115,6 @@
|
|
|
116
115
|
"test.style": "node ../../scripts/verify-framework-style.mjs .",
|
|
117
116
|
"test.build": "pnpm run build && pnpm run build-storybook",
|
|
118
117
|
"check": "concurrently -g \"pnpm:fmt.check\" \"pnpm:lint\" \"pnpm:lint.css\" \"pnpm:build.types\"",
|
|
119
|
-
"check.ci": "
|
|
118
|
+
"check.ci": "pnpm run check && pnpm run test.build && pnpm run test.style && pnpm run test.coverage && pnpm run test.coverage.browser"
|
|
120
119
|
}
|
|
121
120
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type ReactComponentImplementation } from "@a2ui/react/v0_9";
|
|
2
|
-
import { Catalog } from "@a2ui/web_core/v0_9";
|
|
3
|
-
/**
|
|
4
|
-
* The merged component list: the official A2UI basic catalog underneath, with
|
|
5
|
-
* the Elm block implementations layered on top (later entries win by name, so
|
|
6
|
-
* `Column` / `List` / `Divider` / `Icon` resolve to the Elm versions). This is
|
|
7
|
-
* the unit `ElmA2ui` registers under each referenced catalog id.
|
|
8
|
-
*/
|
|
9
|
-
export declare const blockComponents: ReactComponentImplementation[];
|
|
10
|
-
/** Shared catalog functions (from the official basic catalog). */
|
|
11
|
-
export declare const blockFunctions: import("@a2ui/web_core/v0_9").FunctionImplementation[];
|
|
12
|
-
/**
|
|
13
|
-
* A ready-to-use `Catalog` of {@link blockComponents}, registered under the
|
|
14
|
-
* basic-catalog id. `ElmA2ui` rebuilds equivalent catalogs per referenced id;
|
|
15
|
-
* this export is for direct/standalone use.
|
|
16
|
-
*/
|
|
17
|
-
export declare const blockCatalog: Catalog<ReactComponentImplementation>;
|
|
18
|
-
//# sourceMappingURL=block-catalog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block-catalog.d.ts","sourceRoot":"","sources":["../../../../src/components/a2ui/catalog/block-catalog.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAmX9C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,4BAA4B,EAGzD,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,cAAc,wDAA8C,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,4BAA4B,CAI9D,CAAC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
2
|
-
export interface ElmSelectButtonItem {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
/**
|
|
6
|
-
* Optional icon URL displayed alongside the item label.
|
|
7
|
-
*/
|
|
8
|
-
icon?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Whether the item is disabled and cannot be clicked.
|
|
11
|
-
*/
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Called when this item is clicked.
|
|
15
|
-
*/
|
|
16
|
-
onClick?: () => void;
|
|
17
|
-
}
|
|
18
|
-
export interface ElmSelectButtonProps extends Omit<ComponentPropsWithoutRef<"div">, "onClick"> {
|
|
19
|
-
/**
|
|
20
|
-
* Content of the main button.
|
|
21
|
-
*/
|
|
22
|
-
label?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* Optional icon rendered before the main button label.
|
|
25
|
-
*/
|
|
26
|
-
icon?: ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* Entries shown in the dropdown menu.
|
|
29
|
-
*/
|
|
30
|
-
items: ElmSelectButtonItem[];
|
|
31
|
-
/**
|
|
32
|
-
* Split the main action from the dropdown toggle. When `true`, the main
|
|
33
|
-
* button fires `onClick` and only the caret opens the menu. When `false`
|
|
34
|
-
* (default), clicking anywhere on the button toggles the menu.
|
|
35
|
-
*/
|
|
36
|
-
split?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Whether the button uses the primary style. Defaults to `true`.
|
|
39
|
-
*/
|
|
40
|
-
primary?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Custom button color. Overrides `primary` when set.
|
|
43
|
-
*/
|
|
44
|
-
color?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Whether the control fills the width of its container.
|
|
47
|
-
*/
|
|
48
|
-
block?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Whether the whole control is disabled.
|
|
51
|
-
*/
|
|
52
|
-
disabled?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Whether only the main button is disabled (split mode). The dropdown caret
|
|
55
|
-
* stays interactive.
|
|
56
|
-
*/
|
|
57
|
-
disableMainButton?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Whether only the dropdown caret is disabled (split mode). The main button
|
|
60
|
-
* stays interactive.
|
|
61
|
-
*/
|
|
62
|
-
disableDropdown?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Whether the main button is in a loading state.
|
|
65
|
-
*/
|
|
66
|
-
isLoading?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Whether the menu closes automatically after an item is clicked. Defaults
|
|
69
|
-
* to `true`.
|
|
70
|
-
*/
|
|
71
|
-
autoClose?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* mdi path for the caret icon. Defaults to `mdiMenuDown`.
|
|
74
|
-
*/
|
|
75
|
-
dropdownIcon?: string;
|
|
76
|
-
/**
|
|
77
|
-
* Main button click handler (split mode).
|
|
78
|
-
*/
|
|
79
|
-
onClick?: () => void;
|
|
80
|
-
/**
|
|
81
|
-
* Called with the clicked dropdown item.
|
|
82
|
-
*/
|
|
83
|
-
onItemClick?: (item: ElmSelectButtonItem) => void;
|
|
84
|
-
/**
|
|
85
|
-
* Called whenever the dropdown opens or closes.
|
|
86
|
-
*/
|
|
87
|
-
onOpenChange?: (isOpen: boolean) => void;
|
|
88
|
-
}
|
|
89
|
-
export declare const ElmSelectButton: ({ className, style, label, icon, items, split, primary, color, block, disabled, disableMainButton, disableDropdown, isLoading, autoClose, dropdownIcon, onClick, onItemClick, onOpenChange, ...rest }: ElmSelectButtonProps) => import("react").JSX.Element;
|
|
90
|
-
//# sourceMappingURL=elm-select-button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"elm-select-button.d.ts","sourceRoot":"","sources":["../../../src/components/form/elm-select-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,wBAAwB,EAE7B,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAaf,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IACxD;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAE7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH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