@rvx/ui 0.3.7 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/events.d.ts +0 -40
- package/dist/common/events.d.ts.map +1 -1
- package/dist/common/theme.d.ts +3 -134
- package/dist/common/theme.d.ts.map +1 -1
- package/dist/common/theme.js +25 -2
- package/dist/common/theme.js.map +1 -1
- package/dist/common/writing-mode.d.ts +0 -58
- package/dist/common/writing-mode.d.ts.map +1 -1
- package/dist/components/breadcrumbs.d.ts.map +1 -1
- package/dist/components/breadcrumbs.js +3 -4
- package/dist/components/breadcrumbs.js.map +1 -1
- package/dist/components/button.d.ts +0 -18
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +3 -4
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +4 -5
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +4 -5
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapse.d.ts.map +1 -1
- package/dist/components/collapse.js +22 -10
- package/dist/components/collapse.js.map +1 -1
- package/dist/components/column.d.ts +0 -6
- package/dist/components/column.d.ts.map +1 -1
- package/dist/components/column.js +4 -5
- package/dist/components/column.js.map +1 -1
- package/dist/components/control-group.d.ts.map +1 -1
- package/dist/components/control-group.js +3 -4
- package/dist/components/control-group.js.map +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +14 -10
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dropdown-input.d.ts +1 -1
- package/dist/components/dropdown-input.d.ts.map +1 -1
- package/dist/components/dropdown.d.ts +0 -88
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown.js +7 -8
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/error.d.ts.map +1 -1
- package/dist/components/error.js +2 -3
- package/dist/components/error.js.map +1 -1
- package/dist/components/flex-space.d.ts.map +1 -1
- package/dist/components/flex-space.js +3 -4
- package/dist/components/flex-space.js.map +1 -1
- package/dist/components/heading.d.ts +0 -3
- package/dist/components/heading.d.ts.map +1 -1
- package/dist/components/heading.js +2 -3
- package/dist/components/heading.js.map +1 -1
- package/dist/components/label.d.ts.map +1 -1
- package/dist/components/label.js +2 -3
- package/dist/components/label.js.map +1 -1
- package/dist/components/layer.d.ts +0 -63
- package/dist/components/layer.d.ts.map +1 -1
- package/dist/components/link.d.ts +0 -33
- package/dist/components/link.d.ts.map +1 -1
- package/dist/components/link.js +2 -3
- package/dist/components/link.js.map +1 -1
- package/dist/components/nav-list.d.ts +0 -8
- package/dist/components/nav-list.d.ts.map +1 -1
- package/dist/components/nav-list.js +4 -6
- package/dist/components/nav-list.js.map +1 -1
- package/dist/components/notifications.d.ts +4 -1
- package/dist/components/notifications.d.ts.map +1 -1
- package/dist/components/notifications.js +5 -11
- package/dist/components/notifications.js.map +1 -1
- package/dist/components/page.d.ts.map +1 -1
- package/dist/components/page.js +4 -5
- package/dist/components/page.js.map +1 -1
- package/dist/components/placeholder.d.ts.map +1 -1
- package/dist/components/placeholder.js +3 -4
- package/dist/components/placeholder.js.map +1 -1
- package/dist/components/popout.d.ts +0 -96
- package/dist/components/popout.d.ts.map +1 -1
- package/dist/components/popover.d.ts +0 -88
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +9 -9
- package/dist/components/popover.js.map +1 -1
- package/dist/components/radio-buttons.d.ts.map +1 -1
- package/dist/components/radio-buttons.js +4 -5
- package/dist/components/radio-buttons.js.map +1 -1
- package/dist/components/row.d.ts.map +1 -1
- package/dist/components/row.js +4 -5
- package/dist/components/row.js.map +1 -1
- package/dist/components/scroll-view.d.ts.map +1 -1
- package/dist/components/scroll-view.js +8 -9
- package/dist/components/scroll-view.js.map +1 -1
- package/dist/components/secondary.d.ts.map +1 -1
- package/dist/components/secondary.js +2 -3
- package/dist/components/secondary.js.map +1 -1
- package/dist/components/separated.d.ts.map +1 -1
- package/dist/components/separated.js +2 -3
- package/dist/components/separated.js.map +1 -1
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +2 -3
- package/dist/components/slider.js.map +1 -1
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +8 -9
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text-input.d.ts +0 -31
- package/dist/components/text-input.d.ts.map +1 -1
- package/dist/components/text-input.js +2 -3
- package/dist/components/text-input.js.map +1 -1
- package/dist/components/text.d.ts.map +1 -1
- package/dist/components/text.js +2 -3
- package/dist/components/text.js.map +1 -1
- package/dist/components/validation-rules.d.ts +0 -2
- package/dist/components/validation-rules.d.ts.map +1 -1
- package/dist/components/validation.d.ts +0 -49
- package/dist/components/validation.d.ts.map +1 -1
- package/dist/components/value.d.ts.map +1 -1
- package/dist/components/value.js +2 -3
- package/dist/components/value.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +12 -7
- package/src/common/theme.tsx +28 -163
- package/src/components/breadcrumbs.tsx +4 -5
- package/src/components/button.tsx +3 -4
- package/src/components/card.tsx +5 -6
- package/src/components/checkbox.tsx +5 -7
- package/src/components/collapse.tsx +25 -13
- package/src/components/column.tsx +4 -5
- package/src/components/control-group.tsx +3 -4
- package/src/components/dialog.tsx +14 -11
- package/src/components/dropdown-input.tsx +1 -1
- package/src/components/dropdown.tsx +7 -8
- package/src/components/error.tsx +2 -3
- package/src/components/flex-space.tsx +3 -4
- package/src/components/heading.tsx +2 -3
- package/src/components/label.tsx +2 -3
- package/src/components/link.tsx +2 -3
- package/src/components/nav-list.tsx +4 -6
- package/src/components/notifications.tsx +15 -17
- package/src/components/page.tsx +6 -7
- package/src/components/placeholder.tsx +5 -6
- package/src/components/popover.tsx +10 -10
- package/src/components/radio-buttons.tsx +6 -7
- package/src/components/row.tsx +4 -5
- package/src/components/scroll-view.tsx +8 -9
- package/src/components/secondary.tsx +2 -3
- package/src/components/separated.tsx +2 -3
- package/src/components/slider.tsx +2 -5
- package/src/components/tabs.tsx +8 -9
- package/src/components/text-input.tsx +2 -3
- package/src/components/text.tsx +2 -3
- package/src/components/value.tsx +2 -3
- package/src/index.tsx +2 -0
- package/src/types.d.ts +5 -0
- package/{src/theme/components/breadcrumbs.scss → theme/components/breadcrumbs.module.css} +12 -12
- package/theme/components/button.module.css +168 -0
- package/theme/components/card.module.css +50 -0
- package/{src/theme/components/checkbox.scss → theme/components/checkbox.module.css} +5 -5
- package/{src/theme/components/collapse.scss → theme/components/collapse.module.css} +19 -19
- package/{src/theme/components/column.scss → theme/components/column.module.css} +32 -10
- package/{src/theme/components/control-group.scss → theme/components/control-group.module.css} +2 -2
- package/theme/components/dialog.module.css +63 -0
- package/{src/theme/components/dropdown.scss → theme/components/dropdown.module.css} +9 -9
- package/theme/components/error.module.css +4 -0
- package/{src/theme/components/heading.scss → theme/components/heading.module.css} +8 -8
- package/{src/theme/components/label.scss → theme/components/label.module.css} +2 -10
- package/{src/theme/components/link.scss → theme/components/link.module.css} +0 -1
- package/theme/components/nav-list.module.css +76 -0
- package/theme/components/notifications.module.css +31 -0
- package/{src/theme/components/page.scss → theme/components/page.module.css} +6 -10
- package/{src/theme/components/placeholder.scss → theme/components/placeholder.module.css} +3 -3
- package/{src/theme/components/popover.scss → theme/components/popover.module.css} +9 -9
- package/theme/components/row.module.css +36 -0
- package/{src/theme/components/scroll-view.scss → theme/components/scroll-view.module.css} +19 -21
- package/theme/components/secondary.module.css +4 -0
- package/{src/theme/components/separated.scss → theme/components/separated.module.css} +2 -2
- package/{src/theme/components/slider.scss → theme/components/slider.module.css} +2 -1
- package/theme/components/tabs.module.css +71 -0
- package/theme/components/text-input.module.css +45 -0
- package/theme/global.css +118 -0
- package/dist/common/theme-test.d.ts +0 -8
- package/dist/common/theme-test.d.ts.map +0 -1
- package/dist/common/theme-test.js +0 -13
- package/dist/common/theme-test.js.map +0 -1
- package/dist/components/checkbox-test.d.ts +0 -4
- package/dist/components/checkbox-test.d.ts.map +0 -1
- package/dist/components/checkbox-test.js +0 -31
- package/dist/components/checkbox-test.js.map +0 -1
- package/dist/components/collapse-test.d.ts +0 -9
- package/dist/components/collapse-test.d.ts.map +0 -1
- package/dist/components/collapse-test.js +0 -15
- package/dist/components/collapse-test.js.map +0 -1
- package/dist/test.d.ts +0 -4
- package/dist/test.d.ts.map +0 -1
- package/dist/test.js +0 -4
- package/dist/test.js.map +0 -1
- package/dist/theme.module.css +0 -1290
- package/dist/theme.module.css.map +0 -1
- package/src/common/theme-test.tsx +0 -18
- package/src/components/checkbox-test.tsx +0 -35
- package/src/components/collapse-test.tsx +0 -23
- package/src/test.tsx +0 -3
- package/src/theme/base.scss +0 -121
- package/src/theme/common.scss +0 -42
- package/src/theme/components/button.scss +0 -164
- package/src/theme/components/card.scss +0 -41
- package/src/theme/components/dialog.scss +0 -65
- package/src/theme/components/error.scss +0 -12
- package/src/theme/components/nav-list.scss +0 -91
- package/src/theme/components/notifications.scss +0 -61
- package/src/theme/components/row.scss +0 -22
- package/src/theme/components/secondary.scss +0 -4
- package/src/theme/components/tabs.scss +0 -90
- package/src/theme/components/text-input.scss +0 -50
- package/src/theme/theme.scss +0 -31
- /package/{src/theme/components/flex-space.scss → theme/components/flex-space.module.css} +0 -0
- /package/{src/theme/components/radio-buttons.scss → theme/components/radio-buttons.module.css} +0 -0
- /package/{src/theme/components/text.scss → theme/components/text.module.css} +0 -0
- /package/{src/theme/components/value.scss → theme/components/value.module.css} +0 -0
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "rvx/jsx-runtime";
|
|
2
|
+
import styles from "@rvx/ui/theme/components/text-input.module.css";
|
|
2
3
|
import { get, Signal } from "rvx";
|
|
3
4
|
import { isPending } from "rvx/async";
|
|
4
5
|
import { optionalString } from "rvx/convert";
|
|
5
6
|
import { ID_PAIR } from "../common/id-pairs.js";
|
|
6
|
-
import { THEME } from "../common/theme.js";
|
|
7
7
|
import { closestValidator } from "./validation.js";
|
|
8
8
|
export function TextInput(props) {
|
|
9
9
|
const id = props.id ?? ID_PAIR.current.consume();
|
|
10
|
-
const theme = THEME.current;
|
|
11
10
|
const disabled = () => isPending() || get(props.disabled);
|
|
12
11
|
const validator = props.value instanceof Signal ? closestValidator(props.value) : undefined;
|
|
13
12
|
const InputTag = props.multiline ? "textarea" : "input";
|
|
14
13
|
const input = _jsx(InputTag, { type: props.multiline ? undefined : (() => get(props.type) ?? "text"), rows: props.multiline ? props.rows : undefined, wrap: props.multiline ? props.wrap : undefined, disabled: disabled, class: [
|
|
15
|
-
|
|
14
|
+
styles.text_input,
|
|
16
15
|
props.class,
|
|
17
16
|
], style: props.style, id: id, autofocus: props.autofocus, spellcheck: optionalString(props.spellcheck), readonly: !(props.value instanceof Signal), "prop:value": props.value, "on:input": () => {
|
|
18
17
|
if (props.value instanceof Signal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../src/components/text-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA0B,GAAG,EAAE,MAAM,EAAc,MAAM,KAAK,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../src/components/text-input.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,gDAAgD,CAAC;AACpE,OAAO,EAA0B,GAAG,EAAE,MAAM,EAAc,MAAM,KAAK,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CA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AAE,CAAC,CAAC,KAAK,CAAC,KAAK,YAAY,MAAM,CAAC,gBAE9B,KAAK,CAAC,KAAK,cACb,GAAG,EAAE;YACd,IAAI,KAAK,CAAC,KAAK,YAAY,MAAM,EAAE,CAAC;gBACnC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YACjC,CAAC;QACF,CAAC,gBAEW,KAAK,CAAC,YAAY,CAAC,qBACd,KAAK,CAAC,iBAAiB,CAAC,kBAE3B,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,uBACpD,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,GAC1C,CAAC;IAEvB,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEzD,wBAAgB,IAAI,CAAC,KAAK,EAAE;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,EAAE,CAAC,EAAE,UAAU,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAWV"}
|
package/dist/components/text.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "rvx/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import styles from "@rvx/ui/theme/components/text.module.css";
|
|
3
3
|
export function Text(props) {
|
|
4
|
-
const theme = THEME.current;
|
|
5
4
|
return _jsx("div", { class: [
|
|
6
|
-
|
|
5
|
+
styles.text,
|
|
7
6
|
props.class,
|
|
8
7
|
], style: props.style, id: props.id, children: props.children });
|
|
9
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,0CAA0C,CAAC;AAG9D,MAAM,UAAU,IAAI,CAAC,KAKpB;IACA,OAAO,cACN,KAAK,EAAE;YACN,MAAM,CAAC,IAAI;YACX,KAAK,CAAC,KAAK;SACX,EACD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,EAAE,EAAE,KAAK,CAAC,EAAE,YAEX,KAAK,CAAC,QAAQ,GACV,CAAC;AACR,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Component, Expression, Signal } from "rvx";
|
|
2
2
|
export declare function rule<T>(source: Signal<T>, condition: (value: T) => boolean, message: Component): Signal<T>;
|
|
3
3
|
export interface IntParserOptions {
|
|
4
|
-
/** The validation message for invalid formats. */
|
|
5
4
|
format: Component;
|
|
6
|
-
/** The validation message for an out of range value. Defaults to the format message. */
|
|
7
5
|
range?: Component;
|
|
8
6
|
min?: Expression<number>;
|
|
9
7
|
max?: Expression<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-rules.d.ts","sourceRoot":"","sources":["../../src/components/validation-rules.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAK,SAAS,EAAE,UAAU,EAAO,MAAM,EAAgB,MAAM,KAAK,CAAC;AAG1E,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,EAAE,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,CAO1G;AAED,MAAM,WAAW,gBAAgB;
|
|
1
|
+
{"version":3,"file":"validation-rules.d.ts","sourceRoot":"","sources":["../../src/components/validation-rules.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAK,SAAS,EAAE,UAAU,EAAO,MAAM,EAAgB,MAAM,KAAK,CAAC;AAG1E,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,EAAE,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,CAO1G;AAED,MAAM,WAAW,gBAAgB;IAEhC,MAAM,EAAE,SAAS,CAAC;IAElB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,GAAG,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IACzB,GAAG,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;CACzB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CA4B3F"}
|
|
@@ -5,14 +5,6 @@ export interface ValidationOptions {
|
|
|
5
5
|
trigger?: ValidationTrigger;
|
|
6
6
|
}
|
|
7
7
|
export interface ValidationRule {
|
|
8
|
-
/**
|
|
9
|
-
* Validate this rule.
|
|
10
|
-
*
|
|
11
|
-
* Immediately accessed signals may be tracked by the caller to trigger automatic re-validation when updated.
|
|
12
|
-
*
|
|
13
|
-
* @param abortSignal An optional abort signal to abort validaiton if supported.
|
|
14
|
-
* @returns An array of validation message components. If empty, this rule is considered valid.
|
|
15
|
-
*/
|
|
16
8
|
(abortSignal?: AbortSignal): Component[] | undefined | Promise<Component[] | undefined>;
|
|
17
9
|
}
|
|
18
10
|
export declare class ValidationRuleEntry {
|
|
@@ -26,58 +18,17 @@ export declare class Validator {
|
|
|
26
18
|
#private;
|
|
27
19
|
constructor();
|
|
28
20
|
validate(abortSignal?: AbortSignal): Promise<boolean>;
|
|
29
|
-
/**
|
|
30
|
-
* Reactively check if this validator is in an invalid state.
|
|
31
|
-
*
|
|
32
|
-
* @returns `true` if invalid.
|
|
33
|
-
*/
|
|
34
21
|
invalid: () => boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Reactively get a space separated list of message ids.
|
|
37
|
-
*/
|
|
38
22
|
messageIds: () => string;
|
|
39
23
|
get rules(): ValidationRuleEntry[];
|
|
40
|
-
/**
|
|
41
|
-
* Append a rule to this validator until the current lifecycle is disposed.
|
|
42
|
-
*/
|
|
43
24
|
appendRule(rule: ValidationRule): void;
|
|
44
|
-
/**
|
|
45
|
-
* Prepend a rule to this validator until the current lifecycle is disposed.
|
|
46
|
-
*/
|
|
47
25
|
prependRule(rule: ValidationRule): void;
|
|
48
|
-
/**
|
|
49
|
-
* Attach this validator to the specified target.
|
|
50
|
-
*
|
|
51
|
-
* This will overwrite existing validators on the target.
|
|
52
|
-
*/
|
|
53
26
|
attach(target: Signal<unknown>): void;
|
|
54
|
-
/**
|
|
55
|
-
* Find the {@link closestValidator closest validator} or {@link Validator.prototype.attach attach} a new one to the target's {@link Signal.prototype.root root}.
|
|
56
|
-
*/
|
|
57
27
|
static get(target: Signal<unknown>): Validator;
|
|
58
28
|
}
|
|
59
29
|
export type ValidationTarget = Validator | Signal<unknown>;
|
|
60
|
-
/**
|
|
61
|
-
* Get the validator attached to the specified target.
|
|
62
|
-
*
|
|
63
|
-
* @param target The target.
|
|
64
|
-
* @returns The validator or `undefined` if there is none.
|
|
65
|
-
*/
|
|
66
30
|
export declare function validatorFor(target: ValidationTarget): Validator | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Find the closest validator attached to the specified target or any of it's {@link Signal.prototype.source sources}.
|
|
69
|
-
*
|
|
70
|
-
* @param target The target.
|
|
71
|
-
* @returns The validator or `undefined` if there is none.
|
|
72
|
-
*/
|
|
73
31
|
export declare function closestValidator(target: ValidationTarget | undefined): Validator | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* Validate the specified targets in parallel.
|
|
76
|
-
*
|
|
77
|
-
* @param targets The targets that have attached validators.
|
|
78
|
-
* @param abortSignal An optional abort signal to abort validation if supported.
|
|
79
|
-
* @returns `true` if valid.
|
|
80
|
-
*/
|
|
81
32
|
export declare function validate(targets: ValidationTarget[], abortSignal?: AbortSignal): Promise<boolean>;
|
|
82
33
|
export declare function ValidationMessages(props: {
|
|
83
34
|
for: Signal<unknown> | Validator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/components/validation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAK,SAAS,EAAE,OAAO,EAAiB,MAAM,EAAwD,MAAM,KAAK,CAAC;AAQzH,eAAO,MAAM,UAAU,wCAA+C,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,YAAY,GAAG,OAAO,CAAC;AAExE,MAAM,WAAW,iBAAiB;IACjC,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/components/validation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAK,SAAS,EAAE,OAAO,EAAiB,MAAM,EAAwD,MAAM,KAAK,CAAC;AAQzH,eAAO,MAAM,UAAU,wCAA+C,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,YAAY,GAAG,OAAO,CAAC;AAExE,MAAM,WAAW,iBAAiB;IACjC,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAS9B,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,EAAE,GAAG,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC,CAAC;CACxF;AAED,qBAAa,mBAAmB;;gBAKnB,IAAI,EAAE,cAAc,EAA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AAgB,KAAK,CAAC,KAAK,EAAE;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../src/components/value.tsx"],"names":[],"mappings":"AAEA,wBAAgB,KAAK,CAAC,KAAK,EAAE;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAIV"}
|
package/dist/components/value.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "rvx/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import styles from "@rvx/ui/theme/components/value.module.css";
|
|
3
3
|
export function Value(props) {
|
|
4
|
-
|
|
5
|
-
return _jsx("span", { class: [theme?.value], children: props.children });
|
|
4
|
+
return _jsx("span", { class: styles.value, children: props.children });
|
|
6
5
|
}
|
|
7
6
|
//# sourceMappingURL=value.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value.js","sourceRoot":"","sources":["../../src/components/value.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"value.js","sourceRoot":"","sources":["../../src/components/value.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,2CAA2C,CAAC;AAE/D,MAAM,UAAU,KAAK,CAAC,KAErB;IACA,OAAO,eAAM,KAAK,EAAE,MAAM,CAAC,KAAK,YAC9B,KAAK,CAAC,QAAQ,GACT,CAAC;AACT,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC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ClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AAC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c,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"rvx"
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.4.0",
|
|
16
16
|
"type": "module",
|
|
17
17
|
"main": "./dist/index.js",
|
|
18
18
|
"sideEffects": false,
|
|
@@ -21,13 +21,18 @@
|
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"default": "./dist/index.js"
|
|
23
23
|
},
|
|
24
|
-
"./
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
24
|
+
"./theme/": "./theme/"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc -p tsconfig-es.json",
|
|
28
|
+
"start": "tsc -p tsconfig-es.json -w --preserveWatchOutput"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@mxjp/parallel": "^1.0.2",
|
|
32
|
+
"@rvx/ui": "file:.",
|
|
33
|
+
"typescript": "^6.0.2"
|
|
29
34
|
},
|
|
30
35
|
"peerDependencies": {
|
|
31
|
-
"rvx": "^24.1.
|
|
36
|
+
"rvx": "^24.1.3"
|
|
32
37
|
}
|
|
33
38
|
}
|
package/src/common/theme.tsx
CHANGED
|
@@ -1,164 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
button?: string;
|
|
31
|
-
button_default?: string;
|
|
32
|
-
button_primary?: string;
|
|
33
|
-
button_success?: string;
|
|
34
|
-
button_danger?: string;
|
|
35
|
-
button_warning?: string;
|
|
36
|
-
button_input?: string;
|
|
37
|
-
button_item?: string;
|
|
38
|
-
|
|
39
|
-
card?: string;
|
|
40
|
-
card_raw?: string;
|
|
41
|
-
card_default?: string;
|
|
42
|
-
card_info?: string;
|
|
43
|
-
card_success?: string;
|
|
44
|
-
card_warning?: string;
|
|
45
|
-
card_danger?: string;
|
|
46
|
-
|
|
47
|
-
checkbox_label?: string;
|
|
48
|
-
checkbox_padding?: string;
|
|
49
|
-
checkbox_input?: string;
|
|
50
|
-
checkbox_content?: string;
|
|
51
|
-
|
|
52
|
-
collapse?: string;
|
|
53
|
-
collapse_sized?: string;
|
|
54
|
-
collapse_view?: string;
|
|
55
|
-
collapse_alert?: string;
|
|
56
|
-
collapse_visible?: string;
|
|
57
|
-
collapse_content?: string;
|
|
58
|
-
|
|
59
|
-
column?: string;
|
|
60
|
-
column_padded?: string;
|
|
61
|
-
column_content?: string;
|
|
62
|
-
column_group?: string;
|
|
63
|
-
column_control?: string;
|
|
64
|
-
|
|
65
|
-
control_group?: string;
|
|
66
|
-
control_group_row?: string;
|
|
67
|
-
control_group_column?: string;
|
|
68
|
-
|
|
69
|
-
dialog_container?: string;
|
|
70
|
-
dialog_body?: string;
|
|
71
|
-
dialog_fadein?: string;
|
|
72
|
-
dialog_fadeout?: string;
|
|
73
|
-
dialog_scroll_view?: string;
|
|
74
|
-
dialog_scroll_view_content?: string;
|
|
75
|
-
dialog_footer?: string;
|
|
76
|
-
|
|
77
|
-
dropdown?: string;
|
|
78
|
-
dropdown_expansion?: string;
|
|
79
|
-
dropdown_scroll_area?: string;
|
|
80
|
-
dropdown_content?: string;
|
|
81
|
-
dropdown_item?: string;
|
|
82
|
-
dropdown_item_active?: string;
|
|
83
|
-
|
|
84
|
-
flex_space?: string;
|
|
85
|
-
|
|
86
|
-
heading?: string;
|
|
87
|
-
|
|
88
|
-
label?: string;
|
|
89
|
-
|
|
90
|
-
link?: string;
|
|
91
|
-
|
|
92
|
-
nav_list?: string;
|
|
93
|
-
nav_list_item?: string;
|
|
94
|
-
nav_list_item_current?: string;
|
|
95
|
-
|
|
96
|
-
notification_host?: string;
|
|
97
|
-
notification_area?: string;
|
|
98
|
-
notification?: string;
|
|
99
|
-
notification_raw?: string;
|
|
100
|
-
notification_default?: string;
|
|
101
|
-
notification_info?: string;
|
|
102
|
-
notification_success?: string;
|
|
103
|
-
notification_warning?: string;
|
|
104
|
-
notification_danger?: string;
|
|
105
|
-
|
|
106
|
-
page?: string;
|
|
107
|
-
page_center_block?: string;
|
|
108
|
-
page_scrollbar_comp?: string;
|
|
109
|
-
page_content_col?: string;
|
|
110
|
-
page_content?: string;
|
|
111
|
-
|
|
112
|
-
placeholder_area?: string;
|
|
113
|
-
placeholder_content?: string;
|
|
114
|
-
placeholder_message?: string;
|
|
115
|
-
placeholder?: string;
|
|
116
|
-
|
|
117
|
-
popover?: string;
|
|
118
|
-
popover_raw?: string;
|
|
119
|
-
popover_spike_area?: string;
|
|
120
|
-
popover_scroll_area?: string;
|
|
121
|
-
popover_spike?: string;
|
|
122
|
-
popover_content?: string;
|
|
123
|
-
|
|
124
|
-
radio_buttons?: string;
|
|
125
|
-
radio_button_label?: string;
|
|
126
|
-
radio_button_padding?: string;
|
|
127
|
-
radio_button_input?: string;
|
|
128
|
-
radio_button_content?: string;
|
|
129
|
-
|
|
130
|
-
row?: string;
|
|
131
|
-
row_padded?: string;
|
|
132
|
-
row_content?: string;
|
|
133
|
-
row_group?: string;
|
|
134
|
-
row_control?: string;
|
|
135
|
-
|
|
136
|
-
scroll_view?: string;
|
|
137
|
-
scroll_view_area?: string;
|
|
138
|
-
scroll_view_content?: string;
|
|
139
|
-
scroll_view_indicator_start?: string;
|
|
140
|
-
scroll_view_indicator_end?: string;
|
|
141
|
-
scroll_view_indicator_visible?: string;
|
|
142
|
-
|
|
143
|
-
secondary?: string;
|
|
144
|
-
|
|
145
|
-
separated_column?: string;
|
|
146
|
-
separated_row?: string;
|
|
147
|
-
has_separator?: string;
|
|
148
|
-
|
|
149
|
-
slider_host?: string;
|
|
150
|
-
|
|
151
|
-
tab_handle?: string;
|
|
152
|
-
tab_handle_current?: string;
|
|
153
|
-
tab_list?: string;
|
|
154
|
-
tab_list_padded?: string;
|
|
155
|
-
tab_panel?: string;
|
|
156
|
-
|
|
157
|
-
text_input?: string;
|
|
158
|
-
|
|
159
|
-
text?: string;
|
|
160
|
-
|
|
161
|
-
error_message?: string;
|
|
162
|
-
|
|
163
|
-
value?: string;
|
|
1
|
+
import { $, Expression, teardown, watch } from "rvx";
|
|
2
|
+
import { useAbortSignal } from "rvx/async";
|
|
3
|
+
|
|
4
|
+
export type Theme = "dark" | "light";
|
|
5
|
+
|
|
6
|
+
export function watchTheme(value?: Expression<Theme | undefined>) {
|
|
7
|
+
const theme = $<Theme>(undefined!);
|
|
8
|
+
|
|
9
|
+
watch(value, expr => {
|
|
10
|
+
if (expr === undefined) {
|
|
11
|
+
const dark = window.matchMedia("(prefers-color-scheme: dark)");
|
|
12
|
+
const update = () => {
|
|
13
|
+
theme.value = dark.matches ? "dark" : "light";
|
|
14
|
+
};
|
|
15
|
+
dark.addEventListener("change", update, { signal: useAbortSignal() });
|
|
16
|
+
update();
|
|
17
|
+
} else {
|
|
18
|
+
theme.value = expr;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
watch(theme, theme => {
|
|
23
|
+
const className = `rvx-${theme}`;
|
|
24
|
+
document.body.classList.add(className);
|
|
25
|
+
teardown(() => {
|
|
26
|
+
document.body.classList.remove(className);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
164
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import styles from "@rvx/ui/theme/components/breadcrumbs.module.css";
|
|
1
2
|
import { ClassValue, Expression, For, Inject, Show, StyleValue, SVG, XMLNS } from "rvx";
|
|
2
3
|
import { Action } from "../common/events.js";
|
|
3
|
-
import { THEME } from "../common/theme.js";
|
|
4
4
|
import { Link } from "./link.js";
|
|
5
5
|
|
|
6
6
|
export interface Breadcrumb {
|
|
@@ -13,19 +13,18 @@ export function Breadcrumbs(props: {
|
|
|
13
13
|
class?: ClassValue;
|
|
14
14
|
style?: StyleValue;
|
|
15
15
|
}) {
|
|
16
|
-
const theme = THEME.current;
|
|
17
16
|
return <div
|
|
18
17
|
class={[
|
|
19
|
-
|
|
18
|
+
styles.breadcrumbs,
|
|
20
19
|
props.class,
|
|
21
20
|
]}
|
|
22
21
|
style={props.style}
|
|
23
22
|
>
|
|
24
23
|
<For each={props.items}>
|
|
25
24
|
{(item, index) => {
|
|
26
|
-
return <div class={
|
|
25
|
+
return <div class={styles.item}>
|
|
27
26
|
<Show when={() => index() !== 0}>
|
|
28
|
-
{() => <span class={
|
|
27
|
+
{() => <span class={styles.separator}>
|
|
29
28
|
<Inject context={XMLNS} value={SVG}>
|
|
30
29
|
{() => <svg viewBox="0 0 8 16" preserveAspectRatio="none">
|
|
31
30
|
<path d="M2,14 L6,2" stroke-width="1.75" stroke-linecap="round" />
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import styles from "@rvx/ui/theme/components/button.module.css";
|
|
1
2
|
import { ClassValue, Expression, get, StyleValue } from "rvx";
|
|
2
3
|
import { isPending } from "rvx/async";
|
|
3
4
|
import { optionalString } from "rvx/convert";
|
|
4
5
|
import { Action, handleActionEvent, isKey } from "../common/events.js";
|
|
5
|
-
import { THEME } from "../common/theme.js";
|
|
6
6
|
import { Validator } from "./validation.js";
|
|
7
7
|
|
|
8
8
|
export type ButtonType = "button" | "submit" | "reset" | "menu";
|
|
@@ -50,7 +50,6 @@ export function Button(props: {
|
|
|
50
50
|
|
|
51
51
|
children?: unknown;
|
|
52
52
|
}): unknown {
|
|
53
|
-
const theme = THEME.current;
|
|
54
53
|
const disabled = () => isPending() || get(props.disabled);
|
|
55
54
|
|
|
56
55
|
function action(event: Event) {
|
|
@@ -64,8 +63,8 @@ export function Button(props: {
|
|
|
64
63
|
type={() => get(props.type) ?? "button"}
|
|
65
64
|
disabled={disabled}
|
|
66
65
|
class={[
|
|
67
|
-
|
|
68
|
-
() =>
|
|
66
|
+
styles.button,
|
|
67
|
+
() => styles[get(props.variant) ?? "default"],
|
|
69
68
|
props.class,
|
|
70
69
|
]}
|
|
71
70
|
style={props.style}
|
package/src/components/card.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import styles from "@rvx/ui/theme/components/card.module.css";
|
|
1
2
|
import { ClassValue, Expression, map, StyleValue } from "rvx";
|
|
2
|
-
import { THEME } from "../common/theme.js";
|
|
3
3
|
import { SizeContext } from "../common/types.js";
|
|
4
4
|
import { Column } from "./column.js";
|
|
5
5
|
|
|
@@ -7,19 +7,18 @@ export type CardVariant = "default" | "info" | "success" | "warning" | "danger";
|
|
|
7
7
|
|
|
8
8
|
export function Card(props: {
|
|
9
9
|
variant?: Expression<CardVariant | undefined>;
|
|
10
|
-
size?: SizeContext
|
|
10
|
+
size?: Expression<SizeContext | undefined>;
|
|
11
11
|
raw?: boolean;
|
|
12
12
|
class?: ClassValue;
|
|
13
13
|
style?: StyleValue;
|
|
14
14
|
children?: unknown;
|
|
15
15
|
}): unknown {
|
|
16
|
-
const theme = THEME.current;
|
|
17
16
|
return <div
|
|
18
17
|
class={[
|
|
19
18
|
props.class,
|
|
20
|
-
|
|
21
|
-
props.raw ?
|
|
22
|
-
map(props.variant, variant =>
|
|
19
|
+
styles.card,
|
|
20
|
+
props.raw ? styles.raw : undefined,
|
|
21
|
+
map(props.variant, variant => styles[variant ?? "default"]),
|
|
23
22
|
]}
|
|
24
23
|
style={props.style}
|
|
25
24
|
>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ClassValue, Expression, get, Signal, StyleValue, uniqueId, watch } from "rvx";
|
|
2
2
|
import { isPending } from "rvx/async";
|
|
3
|
-
|
|
4
3
|
import { optionalString, string } from "rvx/convert";
|
|
5
4
|
import { ID_PAIR } from "../common/id-pairs.js";
|
|
6
|
-
import { THEME } from "../common/theme.js";
|
|
7
5
|
import { Text } from "./text.js";
|
|
8
6
|
import { closestValidator } from "./validation.js";
|
|
7
|
+
import styles from "@rvx/ui/theme/components/checkbox.module.css";
|
|
9
8
|
|
|
10
9
|
export function Checkbox(props: {
|
|
11
10
|
checked?: Expression<boolean | undefined>;
|
|
@@ -19,7 +18,6 @@ export function Checkbox(props: {
|
|
|
19
18
|
}): unknown {
|
|
20
19
|
const pairId = ID_PAIR.current.consume();
|
|
21
20
|
const id = props.children === undefined ? pairId : uniqueId();
|
|
22
|
-
const theme = THEME.current;
|
|
23
21
|
|
|
24
22
|
const disabled = props.checked instanceof Signal
|
|
25
23
|
? () => isPending() || get(props.disabled)
|
|
@@ -30,7 +28,7 @@ export function Checkbox(props: {
|
|
|
30
28
|
const input = <input
|
|
31
29
|
id={id}
|
|
32
30
|
type="checkbox"
|
|
33
|
-
class={
|
|
31
|
+
class={styles.input}
|
|
34
32
|
on:input={() => {
|
|
35
33
|
if (props.checked instanceof Signal) {
|
|
36
34
|
props.checked.value = input.checked;
|
|
@@ -51,13 +49,13 @@ export function Checkbox(props: {
|
|
|
51
49
|
return <label
|
|
52
50
|
for={id}
|
|
53
51
|
class={[
|
|
54
|
-
|
|
52
|
+
styles.label,
|
|
55
53
|
props.class,
|
|
56
54
|
]}
|
|
57
55
|
style={props.style}
|
|
58
56
|
>
|
|
59
|
-
|
|
60
|
-
<Text class={
|
|
57
|
+
<div class={styles.padding}>{input}</div>
|
|
58
|
+
<Text class={styles.content}>
|
|
61
59
|
{props.children}
|
|
62
60
|
</Text>
|
|
63
61
|
</label>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import styles from "@rvx/ui/theme/components/collapse.module.css";
|
|
1
2
|
import { $, ClassValue, Component, Event, Expression, For, get, map, Signal, StyleValue, teardown, watch } from "rvx";
|
|
2
3
|
import { useMicrotask, useTimeout } from "rvx/async";
|
|
3
4
|
import { optionalString } from "rvx/convert";
|
|
4
|
-
import { THEME } from "../common/theme.js";
|
|
5
5
|
import { AriaLive, AriaRelevant } from "../common/types.js";
|
|
6
6
|
|
|
7
7
|
export function Collapse(props: {
|
|
@@ -16,11 +16,10 @@ export function Collapse(props: {
|
|
|
16
16
|
"aria-relevant"?: Expression<AriaRelevant | undefined>;
|
|
17
17
|
"aria-atomic"?: Expression<boolean | undefined>;
|
|
18
18
|
}): unknown {
|
|
19
|
-
const theme = THEME.current;
|
|
20
19
|
const alert = $(false);
|
|
21
20
|
const size = $<number | undefined>(undefined);
|
|
22
21
|
|
|
23
|
-
const content = <div class={
|
|
22
|
+
const content = <div class={styles.content}>
|
|
24
23
|
{props.children}
|
|
25
24
|
</div> as HTMLDivElement;
|
|
26
25
|
|
|
@@ -46,6 +45,7 @@ export function Collapse(props: {
|
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
47
|
|
|
48
|
+
const transition = $(false);
|
|
49
49
|
let visible = props.visible;
|
|
50
50
|
if (props.fadein !== undefined) {
|
|
51
51
|
const visibleSig = visible = $(false);
|
|
@@ -68,10 +68,10 @@ export function Collapse(props: {
|
|
|
68
68
|
const root = <div
|
|
69
69
|
inert={map(props.visible, v => !v)}
|
|
70
70
|
class={[
|
|
71
|
-
|
|
72
|
-
() => size.value === undefined ? undefined :
|
|
73
|
-
() => alert.value ?
|
|
74
|
-
map(visible, v => v ?
|
|
71
|
+
styles.collapse,
|
|
72
|
+
() => size.value === undefined || !transition.value ? undefined : styles.sized,
|
|
73
|
+
() => alert.value ? styles.alert : undefined,
|
|
74
|
+
map(visible, v => v ? styles.visible : undefined),
|
|
75
75
|
props.class,
|
|
76
76
|
]}
|
|
77
77
|
style={[
|
|
@@ -85,12 +85,25 @@ export function Collapse(props: {
|
|
|
85
85
|
aria-relevant={props["aria-relevant"]}
|
|
86
86
|
aria-atomic={optionalString(props["aria-atomic"])}
|
|
87
87
|
>
|
|
88
|
-
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
</div>
|
|
92
|
-
: content}
|
|
88
|
+
<div class={styles.view}>
|
|
89
|
+
{content}
|
|
90
|
+
</div>
|
|
93
91
|
</div> as HTMLDivElement;
|
|
92
|
+
|
|
93
|
+
watch(visible, () => {
|
|
94
|
+
transition.value = true;
|
|
95
|
+
useMicrotask(() => {
|
|
96
|
+
const duration = parseInt(getComputedStyle(root).getPropertyValue("--layout-transition-ms"));
|
|
97
|
+
if (Number.isSafeInteger(duration)) {
|
|
98
|
+
useTimeout(() => {
|
|
99
|
+
transition.value = false;
|
|
100
|
+
}, duration);
|
|
101
|
+
} else {
|
|
102
|
+
transition.value = false;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
94
107
|
return root;
|
|
95
108
|
}
|
|
96
109
|
|
|
@@ -109,7 +122,6 @@ export function CollapseFor<T>(props: {
|
|
|
109
122
|
each: Expression<Iterable<CollapseItem<T>>>;
|
|
110
123
|
children: Component<T>;
|
|
111
124
|
}): unknown {
|
|
112
|
-
|
|
113
125
|
interface Entry {
|
|
114
126
|
/** item */
|
|
115
127
|
i: CollapseItem<T>;
|