@ecopages/radiant-ui 0.1.0-beta.3 → 0.1.0-beta.6
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/components/ui/autocomplete/autocomplete.css +135 -0
- package/dist/components/ui/autocomplete/autocomplete.d.ts +21 -0
- package/dist/components/ui/autocomplete/autocomplete.script.d.ts +42 -0
- package/dist/components/ui/autocomplete/index.d.ts +2 -0
- package/dist/components/ui/autocomplete/index.js +2 -0
- package/dist/components/ui/autocomplete/index.js.map +7 -0
- package/dist/components/ui/avatar/avatar.css +58 -0
- package/dist/components/ui/avatar/avatar.d.ts +13 -0
- package/dist/components/ui/avatar/index.d.ts +1 -0
- package/dist/components/ui/avatar/index.js +2 -0
- package/dist/components/ui/avatar/index.js.map +7 -0
- package/dist/components/ui/button-group/button-group.css +16 -0
- package/dist/components/ui/button-group/button-group.d.ts +10 -0
- package/dist/components/ui/button-group/index.d.ts +1 -0
- package/dist/components/ui/button-group/index.js +2 -0
- package/dist/components/ui/button-group/index.js.map +7 -0
- package/dist/components/ui/calendar/calendar.css +318 -0
- package/dist/components/ui/calendar/calendar.d.ts +5 -0
- package/dist/components/ui/calendar/calendar.script.d.ts +89 -0
- package/dist/components/ui/calendar/index.d.ts +2 -0
- package/dist/components/ui/calendar/index.js +2 -0
- package/dist/components/ui/calendar/index.js.map +7 -0
- package/dist/components/ui/chip/chip.css +47 -0
- package/dist/components/ui/chip/chip.d.ts +11 -0
- package/dist/components/ui/chip/index.d.ts +1 -0
- package/dist/components/ui/chip/index.js +2 -0
- package/dist/components/ui/chip/index.js.map +7 -0
- package/dist/components/ui/chip-list/chip-list.css +15 -0
- package/dist/components/ui/chip-list/chip-list.d.ts +10 -0
- package/dist/components/ui/chip-list/index.d.ts +1 -0
- package/dist/components/ui/chip-list/index.js +2 -0
- package/dist/components/ui/chip-list/index.js.map +7 -0
- package/dist/components/ui/combobox/combobox.css +42 -80
- package/dist/components/ui/combobox/combobox.d.ts +12 -20
- package/dist/components/ui/combobox/combobox.script.d.ts +15 -14
- package/dist/components/ui/combobox/index.d.ts +2 -1
- package/dist/components/ui/combobox/index.js +1 -1
- package/dist/components/ui/combobox/index.js.map +4 -4
- package/dist/components/ui/date-field/date-field.css +184 -0
- package/dist/components/ui/date-field/date-field.d.ts +10 -0
- package/dist/components/ui/date-field/date-field.script.d.ts +108 -0
- package/dist/components/ui/date-field/index.d.ts +2 -0
- package/dist/components/ui/date-field/index.js +2 -0
- package/dist/components/ui/date-field/index.js.map +7 -0
- package/dist/components/ui/date-range-picker/date-range-picker.css +194 -0
- package/dist/components/ui/date-range-picker/date-range-picker.d.ts +10 -0
- package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +99 -0
- package/dist/components/ui/date-range-picker/index.d.ts +2 -0
- package/dist/components/ui/date-range-picker/index.js +2 -0
- package/dist/components/ui/date-range-picker/index.js.map +7 -0
- package/dist/components/ui/dialog/dialog.css +1 -1
- package/dist/components/ui/feed/feed.css +169 -5
- package/dist/components/ui/feed/feed.d.ts +54 -11
- package/dist/components/ui/feed/index.d.ts +1 -2
- package/dist/components/ui/feed/index.js +1 -1
- package/dist/components/ui/feed/index.js.map +4 -4
- package/dist/components/ui/field/index.js +1 -1
- package/dist/components/ui/field/index.js.map +3 -3
- package/dist/components/ui/form/form-field.test.d.ts +1 -0
- package/dist/components/ui/form/index.js +1 -1
- package/dist/components/ui/form/index.js.map +3 -3
- package/dist/components/ui/heading/heading.css +107 -0
- package/dist/components/ui/heading/heading.d.ts +30 -0
- package/dist/components/ui/heading/index.d.ts +1 -0
- package/dist/components/ui/heading/index.js +2 -0
- package/dist/components/ui/heading/index.js.map +7 -0
- package/dist/components/ui/headline/headline.css +43 -0
- package/dist/components/ui/headline/headline.d.ts +16 -0
- package/dist/components/ui/headline/index.d.ts +1 -0
- package/dist/components/ui/headline/index.js +2 -0
- package/dist/components/ui/headline/index.js.map +7 -0
- package/dist/components/ui/input/index.js +1 -1
- package/dist/components/ui/input/index.js.map +4 -4
- package/dist/components/ui/input/input.d.ts +8 -1
- package/dist/components/ui/label/index.js +1 -1
- package/dist/components/ui/label/index.js.map +2 -2
- package/dist/components/ui/listbox/index.d.ts +1 -1
- package/dist/components/ui/listbox/index.js +1 -1
- package/dist/components/ui/listbox/index.js.map +4 -4
- package/dist/components/ui/listbox/listbox.css +34 -10
- package/dist/components/ui/listbox/listbox.d.ts +12 -4
- package/dist/components/ui/listbox/listbox.script.d.ts +12 -0
- package/dist/components/ui/menu-button/index.js +1 -1
- package/dist/components/ui/menu-button/index.js.map +4 -4
- package/dist/components/ui/menu-button/menu-button.css +24 -8
- package/dist/components/ui/menu-button/menu-button.script.d.ts +3 -4
- package/dist/components/ui/menubar/index.js +1 -1
- package/dist/components/ui/menubar/index.js.map +4 -4
- package/dist/components/ui/menubar/menubar.css +40 -22
- package/dist/components/ui/menubar/menubar.script.d.ts +6 -1
- package/dist/components/ui/number-field/index.d.ts +2 -0
- package/dist/components/ui/number-field/index.js +2 -0
- package/dist/components/ui/number-field/index.js.map +7 -0
- package/dist/components/ui/number-field/number-field.css +185 -0
- package/dist/components/ui/number-field/number-field.d.ts +43 -0
- package/dist/components/ui/number-field/number-field.script.d.ts +104 -0
- package/dist/components/ui/popover/index.d.ts +4 -0
- package/dist/components/ui/popover/index.js +2 -0
- package/dist/components/ui/popover/index.js.map +7 -0
- package/dist/components/ui/popover/popover.css +132 -0
- package/dist/components/ui/popover/popover.d.ts +15 -0
- package/dist/components/ui/popover/popover.script.d.ts +85 -0
- package/dist/components/ui/select/index.d.ts +3 -0
- package/dist/components/ui/select/index.js +2 -0
- package/dist/components/ui/select/index.js.map +7 -0
- package/dist/components/ui/select/select.css +216 -0
- package/dist/components/ui/select/select.d.ts +54 -0
- package/dist/components/ui/select/select.script.d.ts +106 -0
- package/dist/components/ui/shared/collection-navigation.d.ts +8 -0
- package/dist/components/ui/shared/collection-navigation.test.d.ts +1 -0
- package/dist/components/ui/shared/control-toggle.css +132 -0
- package/dist/components/ui/shared/field-label.d.ts +9 -0
- package/dist/components/ui/shared/floating-position.d.ts +13 -2
- package/dist/components/ui/shared/listbox-popover-behavior.d.ts +47 -0
- package/dist/components/ui/shared/listbox-popover-behavior.test.d.ts +1 -0
- package/dist/components/ui/shared/multi-value.d.ts +4 -0
- package/dist/components/ui/shared/popover-controller.d.ts +35 -0
- package/dist/components/ui/shared/popover-controller.test.d.ts +1 -0
- package/dist/components/ui/shared/popover.css +123 -0
- package/dist/components/ui/shared/portal.d.ts +7 -0
- package/dist/components/ui/shared/portal.test.d.ts +1 -0
- package/dist/components/ui/sidebar/index.js +1 -1
- package/dist/components/ui/sidebar/index.js.map +3 -3
- package/dist/components/ui/slider/index.js +1 -1
- package/dist/components/ui/slider/index.js.map +3 -3
- package/dist/components/ui/slider/slider.script.d.ts +5 -12
- package/dist/components/ui/tag-group/index.d.ts +2 -0
- package/dist/components/ui/tag-group/index.js +2 -0
- package/dist/components/ui/tag-group/index.js.map +7 -0
- package/dist/components/ui/tag-group/tag-group.css +184 -0
- package/dist/components/ui/tag-group/tag-group.d.ts +28 -0
- package/dist/components/ui/tag-group/tag-group.script.d.ts +65 -0
- package/dist/components/ui/textarea/index.js +1 -1
- package/dist/components/ui/textarea/index.js.map +2 -2
- package/dist/components/ui/toc/index.js +1 -1
- package/dist/components/ui/toc/index.js.map +3 -3
- package/dist/components/ui/toc/toc.css +1 -1
- package/dist/components/ui/toc/toc.ssr.test.d.ts +1 -0
- package/dist/components/ui/toc/toc.test.d.ts +1 -0
- package/dist/components/ui/tooltip/index.js +1 -1
- package/dist/components/ui/tooltip/index.js.map +3 -3
- package/dist/index.d.ts +14 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/lib/icons/calendar.d.ts +3 -0
- package/dist/lib/icons/chevron-down.d.ts +3 -0
- package/dist/lib/icons/index.d.ts +3 -0
- package/dist/lib/icons/types.d.ts +4 -0
- package/dist/lib/intl/locale.d.ts +3 -0
- package/dist/lib/intl-date/calendar.d.ts +25 -0
- package/dist/lib/intl-date/formatters.d.ts +13 -0
- package/dist/lib/intl-date/index.d.ts +12 -0
- package/dist/lib/intl-date/iso.d.ts +6 -0
- package/dist/lib/intl-date/months.d.ts +12 -0
- package/dist/lib/intl-date/parts.d.ts +15 -0
- package/dist/lib/intl-date/parts.test.d.ts +1 -0
- package/dist/lib/intl-date/segments.d.ts +32 -0
- package/dist/lib/intl-date/segments.test.d.ts +1 -0
- package/dist/lib/intl-date/selection.d.ts +39 -0
- package/dist/lib/intl-date/selection.test.d.ts +1 -0
- package/dist/lib/intl-date/types.d.ts +17 -0
- package/dist/lib/intl-number/format.d.ts +9 -0
- package/dist/lib/intl-number/index.d.ts +2 -0
- package/dist/lib/intl-number/range.d.ts +3 -0
- package/dist/lib/intrinsic.d.ts +13 -0
- package/dist/lib/mask/date-mask.d.ts +29 -0
- package/dist/lib/mask/date-mask.test.d.ts +1 -0
- package/dist/lib/mask/index.d.ts +4 -0
- package/dist/lib/mask/input-mask.d.ts +52 -0
- package/dist/lib/mask/input-mask.test.d.ts +1 -0
- package/dist/lib/text-filter.d.ts +7 -0
- package/dist/lib/text-filter.test.d.ts +1 -0
- package/dist/styles/radiant-ui-core.css +131 -1
- package/dist/styles/radiant-ui.css +142 -1
- package/dist/styles/styles.css +4504 -2395
- package/dist/styles/tailwind.css +142 -1
- package/dist/styles/tokens/typography/default.css +8 -0
- package/package.json +106 -15
- package/dist/components/ui/feed/feed.script.d.ts +0 -22
- package/dist/components/ui/spinbutton/index.d.ts +0 -2
- package/dist/components/ui/spinbutton/index.js +0 -2
- package/dist/components/ui/spinbutton/index.js.map +0 -7
- package/dist/components/ui/spinbutton/spinbutton.css +0 -69
- package/dist/components/ui/spinbutton/spinbutton.d.ts +0 -5
- package/dist/components/ui/spinbutton/spinbutton.script.d.ts +0 -64
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer components {
|
|
4
|
+
.rui-autocomplete {
|
|
5
|
+
display: flex;
|
|
6
|
+
min-height: 0px;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
}
|
|
9
|
+
.rui-autocomplete__input {
|
|
10
|
+
min-width: 0px;
|
|
11
|
+
border-radius: var(--radius-control, var(--radius-control));
|
|
12
|
+
border-style: var(--tw-border-style);
|
|
13
|
+
border-width: 1px;
|
|
14
|
+
border-color: var(--color-border, var(--border));
|
|
15
|
+
background-color: var(--color-background, var(--background));
|
|
16
|
+
padding-inline: var(--spacing-3, var(--space-3));
|
|
17
|
+
padding-block: var(--spacing-2, var(--space-2));
|
|
18
|
+
font-size: var(--text-sm, var(--text-sm));
|
|
19
|
+
line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
|
|
20
|
+
color: var(--color-on-background, var(--on-background));
|
|
21
|
+
--tw-outline-style: none;
|
|
22
|
+
outline-style: none;
|
|
23
|
+
}
|
|
24
|
+
.rui-autocomplete__input:focus-visible {
|
|
25
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
26
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
27
|
+
--tw-ring-color: var(--color-focus-ring, var(--focus-ring));
|
|
28
|
+
}
|
|
29
|
+
.rui-autocomplete__collection {
|
|
30
|
+
min-height: 0px;
|
|
31
|
+
flex: 1;
|
|
32
|
+
overflow: auto;
|
|
33
|
+
}
|
|
34
|
+
.rui-autocomplete__empty {
|
|
35
|
+
padding-inline: var(--spacing-3, var(--space-3));
|
|
36
|
+
padding-block: var(--spacing-2, var(--space-2));
|
|
37
|
+
font-size: var(--text-sm, var(--text-sm));
|
|
38
|
+
line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
|
|
39
|
+
color: var(--color-on-surface, var(--on-surface));
|
|
40
|
+
}
|
|
41
|
+
.rui-autocomplete__empty[hidden] {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
@property --tw-border-style {
|
|
46
|
+
syntax: "*";
|
|
47
|
+
inherits: false;
|
|
48
|
+
initial-value: solid;
|
|
49
|
+
}
|
|
50
|
+
@property --tw-shadow {
|
|
51
|
+
syntax: "*";
|
|
52
|
+
inherits: false;
|
|
53
|
+
initial-value: 0 0 #0000;
|
|
54
|
+
}
|
|
55
|
+
@property --tw-shadow-color {
|
|
56
|
+
syntax: "*";
|
|
57
|
+
inherits: false;
|
|
58
|
+
}
|
|
59
|
+
@property --tw-shadow-alpha {
|
|
60
|
+
syntax: "<percentage>";
|
|
61
|
+
inherits: false;
|
|
62
|
+
initial-value: 100%;
|
|
63
|
+
}
|
|
64
|
+
@property --tw-inset-shadow {
|
|
65
|
+
syntax: "*";
|
|
66
|
+
inherits: false;
|
|
67
|
+
initial-value: 0 0 #0000;
|
|
68
|
+
}
|
|
69
|
+
@property --tw-inset-shadow-color {
|
|
70
|
+
syntax: "*";
|
|
71
|
+
inherits: false;
|
|
72
|
+
}
|
|
73
|
+
@property --tw-inset-shadow-alpha {
|
|
74
|
+
syntax: "<percentage>";
|
|
75
|
+
inherits: false;
|
|
76
|
+
initial-value: 100%;
|
|
77
|
+
}
|
|
78
|
+
@property --tw-ring-color {
|
|
79
|
+
syntax: "*";
|
|
80
|
+
inherits: false;
|
|
81
|
+
}
|
|
82
|
+
@property --tw-ring-shadow {
|
|
83
|
+
syntax: "*";
|
|
84
|
+
inherits: false;
|
|
85
|
+
initial-value: 0 0 #0000;
|
|
86
|
+
}
|
|
87
|
+
@property --tw-inset-ring-color {
|
|
88
|
+
syntax: "*";
|
|
89
|
+
inherits: false;
|
|
90
|
+
}
|
|
91
|
+
@property --tw-inset-ring-shadow {
|
|
92
|
+
syntax: "*";
|
|
93
|
+
inherits: false;
|
|
94
|
+
initial-value: 0 0 #0000;
|
|
95
|
+
}
|
|
96
|
+
@property --tw-ring-inset {
|
|
97
|
+
syntax: "*";
|
|
98
|
+
inherits: false;
|
|
99
|
+
}
|
|
100
|
+
@property --tw-ring-offset-width {
|
|
101
|
+
syntax: "<length>";
|
|
102
|
+
inherits: false;
|
|
103
|
+
initial-value: 0px;
|
|
104
|
+
}
|
|
105
|
+
@property --tw-ring-offset-color {
|
|
106
|
+
syntax: "*";
|
|
107
|
+
inherits: false;
|
|
108
|
+
initial-value: #fff;
|
|
109
|
+
}
|
|
110
|
+
@property --tw-ring-offset-shadow {
|
|
111
|
+
syntax: "*";
|
|
112
|
+
inherits: false;
|
|
113
|
+
initial-value: 0 0 #0000;
|
|
114
|
+
}
|
|
115
|
+
@layer properties {
|
|
116
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
117
|
+
*, ::before, ::after, ::backdrop {
|
|
118
|
+
--tw-border-style: solid;
|
|
119
|
+
--tw-shadow: 0 0 #0000;
|
|
120
|
+
--tw-shadow-color: initial;
|
|
121
|
+
--tw-shadow-alpha: 100%;
|
|
122
|
+
--tw-inset-shadow: 0 0 #0000;
|
|
123
|
+
--tw-inset-shadow-color: initial;
|
|
124
|
+
--tw-inset-shadow-alpha: 100%;
|
|
125
|
+
--tw-ring-color: initial;
|
|
126
|
+
--tw-ring-shadow: 0 0 #0000;
|
|
127
|
+
--tw-inset-ring-color: initial;
|
|
128
|
+
--tw-inset-ring-shadow: 0 0 #0000;
|
|
129
|
+
--tw-ring-inset: initial;
|
|
130
|
+
--tw-ring-offset-width: 0px;
|
|
131
|
+
--tw-ring-offset-color: #fff;
|
|
132
|
+
--tw-ring-offset-shadow: 0 0 #0000;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { JsxHtmlProps, JsxHtmlPropsWithChildren } from '@ecopages/jsx';
|
|
2
|
+
import type { RuiAutocompleteProps } from './autocomplete.script';
|
|
3
|
+
export type RuiAutocompleteInputProps = JsxHtmlProps<{
|
|
4
|
+
slot?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
'aria-label'?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
/** Search field slotted into `RuiAutocomplete`. Also pairs with combobox inputs via `data-autocomplete-input`. */
|
|
10
|
+
export declare function RuiAutocompleteInput({ placeholder, slot, class: className, disabled, ...props }: RuiAutocompleteInputProps): import("@ecopages/jsx").JsxRenderable;
|
|
11
|
+
export type RuiAutocompleteCollectionProps = JsxHtmlPropsWithChildren<{
|
|
12
|
+
slot?: string;
|
|
13
|
+
}>;
|
|
14
|
+
/** Wrapper around the filterable collection inside `RuiAutocomplete`. */
|
|
15
|
+
export declare function RuiAutocompleteCollection({ children, class: className, ...props }: RuiAutocompleteCollectionProps): import("@ecopages/jsx").JsxRenderable;
|
|
16
|
+
export type RuiAutocompleteEmptyProps = JsxHtmlPropsWithChildren;
|
|
17
|
+
/** Shown when filtering yields no visible items. */
|
|
18
|
+
export declare function RuiAutocompleteEmpty({ children, class: className, ...props }: RuiAutocompleteEmptyProps): import("@ecopages/jsx").JsxRenderable;
|
|
19
|
+
export declare const RuiAutocomplete: import("@/lib/radiant-view").RadiantViewComponent<JsxHtmlPropsWithChildren<RuiAutocompleteProps & {
|
|
20
|
+
slot?: string;
|
|
21
|
+
}>>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { RadiantElement } from '@ecopages/radiant';
|
|
2
|
+
import { type TextFilterSensitivity } from '@/lib/text-filter';
|
|
3
|
+
export type RuiAutocompleteProps = {
|
|
4
|
+
/** Filter sensitivity. Default: `base` (case-insensitive contains). */
|
|
5
|
+
sensitivity?: TextFilterSensitivity;
|
|
6
|
+
/** Controlled filter query. When unset, reads from the slotted input. */
|
|
7
|
+
inputValue?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* `<rui-autocomplete>` — filters a slotted collection from a text input.
|
|
11
|
+
*
|
|
12
|
+
* Wrap a search field (`data-autocomplete-input`) and a collection
|
|
13
|
+
* (`data-autocomplete-collection` or default slot) containing `[role="option"]`,
|
|
14
|
+
* `[role="menuitem"]`, or `[data-tag]` items.
|
|
15
|
+
*
|
|
16
|
+
* @remarks When nested in `rui-combobox`, the combobox input acts as the filter
|
|
17
|
+
* field. `rui-select` uses a dedicated search input inside the popup instead.
|
|
18
|
+
*
|
|
19
|
+
* @see https://react-aria.adobe.com/Autocomplete
|
|
20
|
+
* @element rui-autocomplete
|
|
21
|
+
*/
|
|
22
|
+
export declare class RuiAutocomplete extends RadiantElement {
|
|
23
|
+
sensitivity: TextFilterSensitivity;
|
|
24
|
+
inputValue: string;
|
|
25
|
+
private externalInput;
|
|
26
|
+
private readonly onExternalInput;
|
|
27
|
+
private getInput;
|
|
28
|
+
private bindExternalInput;
|
|
29
|
+
private unbindExternalInput;
|
|
30
|
+
syncFilter(): void;
|
|
31
|
+
private getCollection;
|
|
32
|
+
private getFilterableItems;
|
|
33
|
+
private getItemText;
|
|
34
|
+
private getQuery;
|
|
35
|
+
private applyFilter;
|
|
36
|
+
private initialize;
|
|
37
|
+
connectedCallback(): void;
|
|
38
|
+
disconnectedCallback(): void;
|
|
39
|
+
onPropsUpdated(): void;
|
|
40
|
+
onInput(): void;
|
|
41
|
+
render(): import("@ecopages/jsx").JsxRenderable;
|
|
42
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as mt,jsxs as Rt}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as dt,customElement as wt,onEvent as At,onUpdated as St,prop as ht}from"@ecopages/radiant";function rt(e,t,n="base"){if(!t)return!0;if(n==="case")return e.includes(t);let r=new Intl.Collator(void 0,{sensitivity:n==="accent"?"accent":"base",usage:"search"});for(let c=0;c<=e.length-t.length;c+=1){let E=e.slice(c,c+t.length);if(r.compare(E,t)===0)return!0}return!1}var ut,at,st,lt,ct,pt;function xt(e,t,n,r,c,E){var y,a,L,U,S,z,R,X=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,q=Object.create,J=[q(null),q(null)],Y=t.length;function C(o,d,f){return function(i,u){d&&(u=i,i=e);for(var h=0;h<o.length;h++)u=o[h].apply(i,f?[u]:[]);return f?u:i}}function g(o,d,f,i){if(typeof o!="function"&&(i||o!==void 0))throw new TypeError(d+" must "+(f||"be")+" a function"+(i?"":" or undefined"));return o}function Z(o,d,f,i,u,h,I,m,b,v,P){function F(l){if(!P(l))throw new TypeError("Attempted to access private element on non-instance")}var Q=[].concat(d[0]),H=d[3],W=!I,w=u===1,N=u===3,tt=u===4,T=u===2;function j(l,_,ot){return function(D,it){return _&&(it=D,D=o),ot&&ot(D),s[l].call(D,it)}}if(!W){var s={},B=[],x=N?"get":tt||w?"set":"value";if(b?(v||w?s={get:ft(function(){return H(this)},i,"get"),set:function(l){d[4](this,l)}}:s[x]=H,v||ft(s[x],i,T?"":x)):v||(s=Object.getOwnPropertyDescriptor(o,i)),!v&&!b){if((a=J[+m][i])&&(a^u)!==7)throw Error("Decorating two elements with the same name ("+s[x].name+") is not supported yet");J[+m][i]=u<3?1:u}}for(var p=o,V=Q.length-1;V>=0;V-=f?2:1){var et=g(Q[V],"A decorator","be",!0),nt=f?Q[V-1]:void 0,K={},A={kind:["field","accessor","method","getter","setter","class"][u],name:i,metadata:y,addInitializer:function(l,_){if(l.v)throw new TypeError("attempted to call addInitializer after decoration was finished");g(_,"An initializer","be",!0),h.push(_)}.bind(null,K)};if(W)a=et.call(nt,p,A),K.v=1,g(a,"class decorators","return")&&(p=a);else if(A.static=m,A.private=b,a=A.access={has:b?P.bind():function(l){return i in l}},tt||(a.get=b?T?function(l){return F(l),s.value}:j("get",0,F):function(l){return l[i]}),T||N||(a.set=b?j("set",0,F):function(l,_){l[i]=_}),p=et.call(nt,w?{get:s.get,set:s.set}:s[x],A),K.v=1,w){if(typeof p=="object"&&p)(a=g(p.get,"accessor.get"))&&(s.get=a),(a=g(p.set,"accessor.set"))&&(s.set=a),(a=g(p.init,"accessor.init"))&&B.unshift(a);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else g(p,(v?"field":"method")+" decorators","return")&&(v?B.unshift(p):s[x]=p)}return u<2&&I.push(C(B,m,1),C(h,m,0)),v||W||(b?w?I.splice(-1,0,j("get",m),j("set",m)):I.push(T?s[x]:g.call.bind(s[x])):G(o,i,s)),p}function $(o){return G(o,X,{configurable:!0,enumerable:!0,value:y})}return E!==void 0&&(y=E[X]),y=q(y??null),S=[],z=function(o){o&&S.push(C(o))},R=function(o,d){for(var f=0;f<n.length;f++){var i=n[f],u=i[1],h=7&u;if((8&u)==o&&!h==d){var I=i[2],m=!!i[3],b=16&u;Z(o?e:e.prototype,i,b,m?"#"+I:Et(I),h,h<2?[]:o?U=U||[]:L=L||[],S,!!o,m,d,o&&m?function(v){return _t(v)===e}:c)}}},R(8,0),R(0,0),R(8,1),R(0,1),z(L),z(U),a=S,Y||$(e),{e:a,get c(){var o=[];return Y&&[$(e=Z(e,[t],r,e.name,5,o)),C(o,1)]}}}function Et(e){var t=It(e,"string");return typeof t=="symbol"?t:t+""}function It(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ft(e,t,n){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch{}return e}function _t(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var k,yt=class extends dt{static{({e:[st,lt,ct,pt,ut],c:[k,at]}=xt(this,[wt("rui-autocomplete")],[[ht({type:String,defaultValue:"base"}),0,"sensitivity"],[ht({type:String,attribute:"input-value",defaultValue:""}),0,"inputValue"],[St(["sensitivity","inputValue"]),2,"onPropsUpdated"],[At({selector:"[data-autocomplete-input]",type:"input"}),2,"onInput"]],0,void 0,dt))}sensitivity=(ut(this),st(this));inputValue=(lt(this),ct(this));externalInput=(pt(this),null);onExternalInput=()=>{this.applyFilter()};getInput(){let t=this.querySelector("[data-autocomplete-input]");return t||(this.closest("rui-combobox, rui-select")?.querySelector("[data-autocomplete-input]")??null)}bindExternalInput(){this.unbindExternalInput();let t=this.getInput();!t||this.contains(t)||(this.externalInput=t,t.addEventListener("input",this.onExternalInput))}unbindExternalInput(){this.externalInput?.removeEventListener("input",this.onExternalInput),this.externalInput=null}syncFilter(){this.applyFilter()}getCollection(){return this.querySelector("[data-autocomplete-collection]")??this}getFilterableItems(){let t=this.getCollection();return t?Array.from(t.querySelectorAll('[role="option"], [data-tag], [role="menuitem"]')).filter(r=>this.contains(r)||t.contains(r)):[]}getItemText(t){return t.getAttribute("data-label")||t.textContent?.trim()||""}getQuery(){return this.inputValue?this.inputValue:this.getInput()?.value??""}applyFilter(){let t=this.getQuery(),n=this.getFilterableItems(),r=0;for(let E of n){let y=rt(this.getItemText(E),t,this.sensitivity);E.hidden=!y,y&&(r+=1)}let c=this.querySelector("[data-autocomplete-empty]");c&&(c.hidden=r>0)}initialize(){this.applyFilter()}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>{this.bindExternalInput(),this.initialize()})}disconnectedCallback(){this.unbindExternalInput(),super.disconnectedCallback()}onPropsUpdated(){this.applyFilter()}onInput(){this.applyFilter()}render(){return Rt("div",{class:"rui-autocomplete","data-ref":"root",children:[mt("slot",{name:"input"}),mt("slot",{})]})}static{at()}};import{jsx as O}from"@ecopages/jsx/jsx-runtime";function M(...e){return e.filter(Boolean).join(" ")}var Ct=Symbol.for("@ecopages/storybook-radiant.viewElement"),bt=Symbol.for("@ecopages/storybook-radiant.scriptModule"),vt=Symbol.for("@ecopages/storybook-radiant.scriptExport");function Tt(e,t){e[Ct]=t;let n=t[bt];n&&(e[bt]=n,e[vt]=t[vt]??t.name)}function gt(e,t,n){let r=c=>t(c);return Tt(r,e),r}function jt({placeholder:e,slot:t="input",class:n,disabled:r,...c}){return O("input",{...c,type:"search",slot:t,"data-autocomplete-input":!0,class:M("rui-autocomplete__input",n),placeholder:e,disabled:r,autocomplete:"off"})}function Vt({children:e,class:t,...n}){return O("div",{...n,"data-autocomplete-collection":!0,class:M("rui-autocomplete__collection",t),children:e})}function Dt({children:e,class:t,...n}){return O("div",{...n,"data-autocomplete-empty":!0,class:M("rui-autocomplete__empty",t),hidden:!0,children:e})}var kt=gt(k,({children:e,...t})=>O("rui-autocomplete",{...t,children:e}),{stylesheets:["./autocomplete.css"]});export{kt as RuiAutocomplete,Vt as RuiAutocompleteCollection,k as RuiAutocompleteElement,Dt as RuiAutocompleteEmpty,jt as RuiAutocompleteInput};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/ui/autocomplete/autocomplete.script.tsx", "../../../../src/lib/text-filter.ts", "../../../../src/components/ui/autocomplete/autocomplete.tsx", "../../../../src/lib/cx.ts", "../../../../src/lib/radiant-view.ts"],
|
|
4
|
+
"sourcesContent": ["let _initProto, _initClass, _init_sensitivity, _init_extra_sensitivity, _init_inputValue, _init_extra_inputValue;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { RadiantElement, customElement, onEvent, onUpdated, prop } from \"@ecopages/radiant\";\nimport { textContains } from \"@/lib/text-filter\";\nlet _RuiAutocomplete;\nclass RuiAutocomplete extends RadiantElement {\n static {\n ({\n e: [_init_sensitivity, _init_extra_sensitivity, _init_inputValue, _init_extra_inputValue, _initProto],\n c: [_RuiAutocomplete, _initClass]\n } = _applyDecs(this, [customElement(\"rui-autocomplete\")], [[prop({\n type: String,\n defaultValue: \"base\"\n }), 0, \"sensitivity\"], [prop({\n type: String,\n attribute: \"input-value\",\n defaultValue: \"\"\n }), 0, \"inputValue\"], [onUpdated([\"sensitivity\", \"inputValue\"]), 2, \"onPropsUpdated\"], [onEvent({\n selector: \"[data-autocomplete-input]\",\n type: \"input\"\n }), 2, \"onInput\"]], 0, void 0, RadiantElement));\n }\n sensitivity = (_initProto(this), _init_sensitivity(this));\n inputValue = (_init_extra_sensitivity(this), _init_inputValue(this));\n externalInput = (_init_extra_inputValue(this), null);\n onExternalInput = () => {\n this.applyFilter();\n };\n getInput() {\n const local = this.querySelector(\"[data-autocomplete-input]\");\n if (local) {\n return local;\n }\n const host = this.closest(\"rui-combobox, rui-select\");\n return host?.querySelector(\"[data-autocomplete-input]\") ?? null;\n }\n bindExternalInput() {\n this.unbindExternalInput();\n const input = this.getInput();\n if (!input || this.contains(input)) {\n return;\n }\n this.externalInput = input;\n input.addEventListener(\"input\", this.onExternalInput);\n }\n unbindExternalInput() {\n this.externalInput?.removeEventListener(\"input\", this.onExternalInput);\n this.externalInput = null;\n }\n syncFilter() {\n this.applyFilter();\n }\n getCollection() {\n return this.querySelector(\"[data-autocomplete-collection]\") ?? this;\n }\n getFilterableItems() {\n const collection = this.getCollection();\n if (!collection) {\n return [];\n }\n const options = Array.from(collection.querySelectorAll('[role=\"option\"], [data-tag], [role=\"menuitem\"]'));\n return options.filter(item => this.contains(item) || collection.contains(item));\n }\n getItemText(item) {\n return item.getAttribute(\"data-label\") || item.textContent?.trim() || \"\";\n }\n getQuery() {\n if (this.inputValue) {\n return this.inputValue;\n }\n return this.getInput()?.value ?? \"\";\n }\n applyFilter() {\n const query = this.getQuery();\n const items = this.getFilterableItems();\n let visibleCount = 0;\n for (const item of items) {\n const matches = textContains(this.getItemText(item), query, this.sensitivity);\n item.hidden = !matches;\n if (matches) {\n visibleCount += 1;\n }\n }\n const emptyState = this.querySelector(\"[data-autocomplete-empty]\");\n if (emptyState) {\n emptyState.hidden = visibleCount > 0;\n }\n }\n initialize() {\n this.applyFilter();\n }\n connectedCallback() {\n super.connectedCallback();\n queueMicrotask(() => {\n this.bindExternalInput();\n this.initialize();\n });\n }\n disconnectedCallback() {\n this.unbindExternalInput();\n super.disconnectedCallback();\n }\n onPropsUpdated() {\n this.applyFilter();\n }\n onInput() {\n this.applyFilter();\n }\n render() {\n return /* @__PURE__ */jsxs(\"div\", {\n class: \"rui-autocomplete\",\n \"data-ref\": \"root\",\n children: [/* @__PURE__ */jsx(\"slot\", {\n name: \"input\"\n }), /* @__PURE__ */jsx(\"slot\", {})]\n });\n }\n static {\n _initClass();\n }\n}\nexport { _RuiAutocomplete as RuiAutocomplete };", "export function textContains(text, query, sensitivity = \"base\") {\n if (!query) {\n return true;\n }\n if (sensitivity === \"case\") {\n return text.includes(query);\n }\n const collator = new Intl.Collator(void 0, {\n sensitivity: sensitivity === \"accent\" ? \"accent\" : \"base\",\n usage: \"search\"\n });\n for (let index = 0; index <= text.length - query.length; index += 1) {\n const slice = text.slice(index, index + query.length);\n if (collator.compare(slice, query) === 0) {\n return true;\n }\n }\n return false;\n}", "import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nimport { defineRadiantView } from \"@/lib/radiant-view\";\nimport { RuiAutocomplete as RuiAutocompleteElement } from \"./autocomplete.script\";\nexport function RuiAutocompleteInput({\n placeholder,\n slot = \"input\",\n class: className,\n disabled,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"input\", {\n ...props,\n type: \"search\",\n slot,\n \"data-autocomplete-input\": true,\n class: cx(\"rui-autocomplete__input\", className),\n placeholder,\n disabled,\n autocomplete: \"off\"\n });\n}\nexport function RuiAutocompleteCollection({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n \"data-autocomplete-collection\": true,\n class: cx(\"rui-autocomplete__collection\", className),\n children\n });\n}\nexport function RuiAutocompleteEmpty({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n \"data-autocomplete-empty\": true,\n class: cx(\"rui-autocomplete__empty\", className),\n hidden: true,\n children\n });\n}\nexport const RuiAutocomplete = defineRadiantView(RuiAutocompleteElement, ({\n children,\n ...props\n}) => /* @__PURE__ */jsx(\"rui-autocomplete\", {\n ...props,\n children\n}), {\n stylesheets: [\"./autocomplete.css\"]\n});", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}", "const RADIANT_VIEW_ELEMENT = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.viewElement\");\nconst RADIANT_SCRIPT_MODULE = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.scriptModule\");\nconst RADIANT_SCRIPT_EXPORT = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.scriptExport\");\nconst RADIANT_VIEW_MODULE = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.viewModule\");\nfunction linkViewToElement(view, element) {\n view[RADIANT_VIEW_ELEMENT] = element;\n const ssrModule = element[RADIANT_SCRIPT_MODULE];\n if (ssrModule) {\n view[RADIANT_SCRIPT_MODULE] = ssrModule;\n view[RADIANT_SCRIPT_EXPORT] = element[RADIANT_SCRIPT_EXPORT] ?? element.name;\n }\n}\nexport function defineRadiantView(element, render, _options) {\n const view = args => render(args);\n linkViewToElement(view, element);\n return view;\n}\nexport function attachRadiantStylesheets(target, _stylesheets, moduleUrl) {\n const view = target;\n view[RADIANT_VIEW_MODULE] = moduleUrl;\n return target;\n}\nexport function syncRadiantViewMetadata(view) {\n const element = view[RADIANT_VIEW_ELEMENT];\n if (element) {\n linkViewToElement(view, element);\n }\n}"],
|
|
5
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nC,YAAAC,EACA,KAAAC,EAAO,QACP,MAAOC,EACP,SAAAC,EACA,GAAGC,CACL,EAAG,CACD,OAAsBC,EAAI,QAAS,CACjC,GAAGD,EACH,KAAM,SACN,KAAAH,EACA,0BAA2B,GAC3B,MAAOK,EAAG,0BAA2BJ,CAAS,EAC9C,YAAAF,EACA,SAAAG,EACA,aAAc,KAChB,CAAC,CACH,CACO,SAASI,GAA0B,CACxC,SAAAC,EACA,MAAON,EACP,GAAGE,CACL,EAAG,CACD,OAAsBC,EAAI,MAAO,CAC/B,GAAGD,EACH,+BAAgC,GAChC,MAAOE,EAAG,+BAAgCJ,CAAS,EACnD,SAAAM,CACF,CAAC,CACH,CACO,SAASC,GAAqB,CACnC,SAAAD,EACA,MAAON,EACP,GAAGE,CACL,EAAG,CACD,OAAsBC,EAAI,MAAO,CAC/B,GAAGD,EACH,0BAA2B,GAC3B,MAAOE,EAAG,0BAA2BJ,CAAS,EAC9C,OAAQ,GACR,SAAAM,CACF,CAAC,CACH,CACO,IAAME,GAAkBC,GAAkBC,EAAwB,CAAC,CACxE,SAAAJ,EACA,GAAGJ,CACL,IAAqBC,EAAI,mBAAoB,CAC3C,GAAGD,EACH,SAAAI,CACF,CAAC,EAAG,CACF,YAAa,CAAC,oBAAoB,CACpC,CAAC",
|
|
6
|
+
"names": ["jsx", "jsxs", "RadiantElement", "customElement", "onEvent", "onUpdated", "prop", "textContains", "text", "query", "sensitivity", "collator", "index", "slice", "_initProto", "_initClass", "_init_sensitivity", "_init_extra_sensitivity", "_init_inputValue", "_init_extra_inputValue", "_applyDecs", "o", "i", "a", "c", "u", "s", "f", "l", "p", "d", "m", "h", "y", "v", "g", "t", "n", "r", "b", "e", "applyDec", "w", "D", "S", "j", "E", "I", "P", "k", "F", "_setFunctionName", "N", "O", "T", "z", "A", "H", "_toPropertyKey", "_checkInRHS", "_toPrimitive", "_RuiAutocomplete", "RuiAutocomplete", "RadiantElement", "customElement", "prop", "onUpdated", "onEvent", "local", "input", "collection", "item", "query", "items", "visibleCount", "matches", "textContains", "emptyState", "jsxs", "jsx", "jsx", "cx", "parts", "RADIANT_VIEW_ELEMENT", "RADIANT_SCRIPT_MODULE", "RADIANT_SCRIPT_EXPORT", "linkViewToElement", "view", "element", "RADIANT_VIEW_ELEMENT", "ssrModule", "RADIANT_SCRIPT_MODULE", "RADIANT_SCRIPT_EXPORT", "defineRadiantView", "render", "_options", "args", "RuiAutocompleteInput", "placeholder", "slot", "className", "disabled", "props", "jsx", "cx", "RuiAutocompleteCollection", "children", "RuiAutocompleteEmpty", "RuiAutocomplete", "defineRadiantView", "_RuiAutocomplete"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer components {
|
|
4
|
+
.rui-avatar {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
border-radius: var(--radius-pill, var(--radius-pill));
|
|
12
|
+
background-color: var(--color-surface-container, var(--surface-container));
|
|
13
|
+
--tw-font-weight: var(--font-weight-medium, var(--weight-medium));
|
|
14
|
+
font-weight: var(--font-weight-medium, var(--weight-medium));
|
|
15
|
+
color: var(--color-on-surface, var(--on-surface));
|
|
16
|
+
}
|
|
17
|
+
.rui-avatar--sm {
|
|
18
|
+
width: var(--spacing-8, var(--space-8));
|
|
19
|
+
height: var(--spacing-8, var(--space-8));
|
|
20
|
+
font-size: var(--text-xs, var(--text-xs));
|
|
21
|
+
line-height: var(--tw-leading, var(--text-xs--line-height, calc(1 / 0.75)));
|
|
22
|
+
}
|
|
23
|
+
.rui-avatar--md {
|
|
24
|
+
width: calc(var(--spacing, 0.25rem) * 10);
|
|
25
|
+
height: calc(var(--spacing, 0.25rem) * 10);
|
|
26
|
+
font-size: var(--text-sm, var(--text-sm));
|
|
27
|
+
line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
|
|
28
|
+
}
|
|
29
|
+
.rui-avatar--lg {
|
|
30
|
+
width: calc(var(--spacing, 0.25rem) * 12);
|
|
31
|
+
height: calc(var(--spacing, 0.25rem) * 12);
|
|
32
|
+
font-size: var(--text-body, var(--text-body));
|
|
33
|
+
}
|
|
34
|
+
.rui-avatar__image {
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
object-fit: cover;
|
|
38
|
+
}
|
|
39
|
+
.rui-avatar__fallback {
|
|
40
|
+
display: flex;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
text-transform: uppercase;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
@property --tw-font-weight {
|
|
49
|
+
syntax: "*";
|
|
50
|
+
inherits: false;
|
|
51
|
+
}
|
|
52
|
+
@layer properties {
|
|
53
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
54
|
+
*, ::before, ::after, ::backdrop {
|
|
55
|
+
--tw-font-weight: initial;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JsxHtmlPropsWithChildren } from '@ecopages/jsx';
|
|
2
|
+
export type RuiAvatarSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export type RuiAvatarProps = JsxHtmlPropsWithChildren<{
|
|
4
|
+
/** Image URL. When omitted or broken, initials from `alt` / `fallback` are shown. */
|
|
5
|
+
src?: string;
|
|
6
|
+
/** Accessible name for the image. Also used to derive initials when `fallback` is omitted. */
|
|
7
|
+
alt?: string;
|
|
8
|
+
/** Explicit fallback initials / text when there is no image. */
|
|
9
|
+
fallback?: string;
|
|
10
|
+
size?: RuiAvatarSize;
|
|
11
|
+
}>;
|
|
12
|
+
/** Image avatar with initials fallback. */
|
|
13
|
+
export declare function RuiAvatar({ src, alt, fallback, size, class: className, children, ...props }: RuiAvatarProps): import("@ecopages/jsx").JsxRenderable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RuiAvatar, type RuiAvatarProps, type RuiAvatarSize } from './avatar';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as i}from"@ecopages/jsx/jsx-runtime";function e(...t){return t.filter(Boolean).join(" ")}var d=Symbol.for("@ecopages/storybook-radiant.viewModule");function n(t,o,r){let a=t;return a[d]=r,t}function f(t){let o=t.trim().split(/\s+/).filter(Boolean);return o.length===0?"?":o.length===1?o[0].slice(0,2).toUpperCase():`${o[0][0]??""}${o[1][0]??""}`.toUpperCase()}function s({src:t,alt:o="",fallback:r,size:a="md",class:c,children:l,...p}){let u=r??(o?f(o):void 0);return i("span",{...p,class:e("rui-avatar",`rui-avatar--${a}`,c),role:t?void 0:"img","aria-label":t?void 0:o||r,children:t?i("img",{class:"rui-avatar__image",src:t,alt:o}):i("span",{class:"rui-avatar__fallback","aria-hidden":o||r?"true":void 0,children:l??u??"?"})})}n(s,["./avatar.css"],import.meta.url);export{s as RuiAvatar};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/ui/avatar/avatar.tsx", "../../../../src/lib/cx.ts", "../../../../src/lib/radiant-view.ts"],
|
|
4
|
+
"sourcesContent": ["import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nimport { attachRadiantStylesheets } from \"@/lib/radiant-view\";\nfunction initialsFrom(label) {\n const parts = label.trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) return \"?\";\n if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();\n return `${parts[0][0] ?? \"\"}${parts[1][0] ?? \"\"}`.toUpperCase();\n}\nexport function RuiAvatar({\n src,\n alt = \"\",\n fallback,\n size = \"md\",\n class: className,\n children,\n ...props\n}) {\n const label = fallback ?? (alt ? initialsFrom(alt) : void 0);\n return /* @__PURE__ */jsx(\"span\", {\n ...props,\n class: cx(\"rui-avatar\", `rui-avatar--${size}`, className),\n role: src ? void 0 : \"img\",\n \"aria-label\": src ? void 0 : alt || fallback,\n children: src ? /* @__PURE__ */jsx(\"img\", {\n class: \"rui-avatar__image\",\n src,\n alt\n }) : /* @__PURE__ */jsx(\"span\", {\n class: \"rui-avatar__fallback\",\n \"aria-hidden\": alt || fallback ? \"true\" : void 0,\n children: children ?? label ?? \"?\"\n })\n });\n}\nattachRadiantStylesheets(RuiAvatar, [\"./avatar.css\"], import.meta.url);", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}", "const RADIANT_VIEW_ELEMENT = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.viewElement\");\nconst RADIANT_SCRIPT_MODULE = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.scriptModule\");\nconst RADIANT_SCRIPT_EXPORT = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.scriptExport\");\nconst RADIANT_VIEW_MODULE = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.viewModule\");\nfunction linkViewToElement(view, element) {\n view[RADIANT_VIEW_ELEMENT] = element;\n const ssrModule = element[RADIANT_SCRIPT_MODULE];\n if (ssrModule) {\n view[RADIANT_SCRIPT_MODULE] = ssrModule;\n view[RADIANT_SCRIPT_EXPORT] = element[RADIANT_SCRIPT_EXPORT] ?? element.name;\n }\n}\nexport function defineRadiantView(element, render, _options) {\n const view = args => render(args);\n linkViewToElement(view, element);\n return view;\n}\nexport function attachRadiantStylesheets(target, _stylesheets, moduleUrl) {\n const view = target;\n view[RADIANT_VIEW_MODULE] = moduleUrl;\n return target;\n}\nexport function syncRadiantViewMetadata(view) {\n const element = view[RADIANT_VIEW_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": ["jsx", "cx", "parts", "RADIANT_VIEW_MODULE", "attachRadiantStylesheets", "target", "_stylesheets", "moduleUrl", "view", "RADIANT_VIEW_MODULE", "initialsFrom", "label", "parts", "RuiAvatar", "src", "alt", "fallback", "size", "className", "children", "props", "jsx", "cx", "attachRadiantStylesheets"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer components {
|
|
3
|
+
.rui-button-group {
|
|
4
|
+
display: flex;
|
|
5
|
+
gap: var(--spacing-inline, var(--space-inline));
|
|
6
|
+
}
|
|
7
|
+
.rui-button-group--horizontal {
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
align-items: center;
|
|
11
|
+
}
|
|
12
|
+
.rui-button-group--vertical {
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: stretch;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JsxHtmlPropsWithChildren } from '@ecopages/jsx';
|
|
2
|
+
export type RuiButtonGroupOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
export type RuiButtonGroupProps = JsxHtmlPropsWithChildren<{
|
|
4
|
+
/** Layout direction. Default: `horizontal`. */
|
|
5
|
+
orientation?: RuiButtonGroupOrientation;
|
|
6
|
+
/** Accessible name when the group has no visible label. */
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
}>;
|
|
9
|
+
/** Related buttons / links in a horizontal or vertical group. */
|
|
10
|
+
export declare function RuiButtonGroup({ children, orientation, class: className, 'aria-label': ariaLabel, ...props }: RuiButtonGroupProps): import("@ecopages/jsx").JsxRenderable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RuiButtonGroup, type RuiButtonGroupOrientation, type RuiButtonGroupProps } from './button-group';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as c}from"@ecopages/jsx/jsx-runtime";function e(...o){return o.filter(Boolean).join(" ")}var u=Symbol.for("@ecopages/storybook-radiant.viewModule");function a(o,t,r){let n=o;return n[u]=r,o}function i({children:o,orientation:t="horizontal",class:r,"aria-label":n,...s}){return c("div",{...s,role:"group","aria-label":n,"aria-orientation":t,class:e("rui-button-group",`rui-button-group--${t}`,r),children:o})}a(i,["./button-group.css"],import.meta.url);export{i as RuiButtonGroup};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/ui/button-group/button-group.tsx", "../../../../src/lib/cx.ts", "../../../../src/lib/radiant-view.ts"],
|
|
4
|
+
"sourcesContent": ["import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nimport { attachRadiantStylesheets } from \"@/lib/radiant-view\";\nexport function RuiButtonGroup({\n children,\n orientation = \"horizontal\",\n class: className,\n \"aria-label\": ariaLabel,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n role: \"group\",\n \"aria-label\": ariaLabel,\n \"aria-orientation\": orientation,\n class: cx(\"rui-button-group\", `rui-button-group--${orientation}`, className),\n children\n });\n}\nattachRadiantStylesheets(RuiButtonGroup, [\"./button-group.css\"], import.meta.url);", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}", "const RADIANT_VIEW_ELEMENT = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.viewElement\");\nconst RADIANT_SCRIPT_MODULE = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.scriptModule\");\nconst RADIANT_SCRIPT_EXPORT = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.scriptExport\");\nconst RADIANT_VIEW_MODULE = /* @__PURE__ */Symbol.for(\"@ecopages/storybook-radiant.viewModule\");\nfunction linkViewToElement(view, element) {\n view[RADIANT_VIEW_ELEMENT] = element;\n const ssrModule = element[RADIANT_SCRIPT_MODULE];\n if (ssrModule) {\n view[RADIANT_SCRIPT_MODULE] = ssrModule;\n view[RADIANT_SCRIPT_EXPORT] = element[RADIANT_SCRIPT_EXPORT] ?? element.name;\n }\n}\nexport function defineRadiantView(element, render, _options) {\n const view = args => render(args);\n linkViewToElement(view, element);\n return view;\n}\nexport function attachRadiantStylesheets(target, _stylesheets, moduleUrl) {\n const view = target;\n view[RADIANT_VIEW_MODULE] = moduleUrl;\n return target;\n}\nexport function syncRadiantViewMetadata(view) {\n const element = view[RADIANT_VIEW_ELEMENT];\n if (element) {\n linkViewToElement(view, element);\n }\n}"],
|
|
5
|
+
"mappings": "AAAA,OAAS,OAAAA,MAAW,4BCAb,SAASC,KAAMC,EAAO,CAC3B,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACvC,CCCA,IAAMC,EAAqC,OAAO,IAAI,wCAAwC,EAcvF,SAASC,EAAyBC,EAAQC,EAAcC,EAAW,CACxE,IAAMC,EAAOH,EACb,OAAAG,EAAKC,CAAmB,EAAIF,EACrBF,CACT,CFlBO,SAASK,EAAe,CAC7B,SAAAC,EACA,YAAAC,EAAc,aACd,MAAOC,EACP,aAAcC,EACd,GAAGC,CACL,EAAG,CACD,OAAsBC,EAAI,MAAO,CAC/B,GAAGD,EACH,KAAM,QACN,aAAcD,EACd,mBAAoBF,EACpB,MAAOK,EAAG,mBAAoB,qBAAqBL,CAAW,GAAIC,CAAS,EAC3E,SAAAF,CACF,CAAC,CACH,CACAO,EAAyBR,EAAgB,CAAC,oBAAoB,EAAG,YAAY,GAAG",
|
|
6
|
+
"names": ["jsx", "cx", "parts", "RADIANT_VIEW_MODULE", "attachRadiantStylesheets", "target", "_stylesheets", "moduleUrl", "view", "RADIANT_VIEW_MODULE", "RuiButtonGroup", "children", "orientation", "className", "ariaLabel", "props", "jsx", "cx", "attachRadiantStylesheets"]
|
|
7
|
+
}
|