@visitwonders/assembly 0.1.0 → 0.3.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/declarations/action/button-group.d.ts +89 -0
- package/declarations/action/button-group.d.ts.map +1 -0
- package/declarations/action/button.d.ts +4 -0
- package/declarations/action/button.d.ts.map +1 -1
- package/declarations/action/index.d.ts +1 -0
- package/declarations/action/index.d.ts.map +1 -1
- package/declarations/components/form/checkbox.d.ts +0 -65
- package/declarations/components/form/control.d.ts +0 -36
- package/declarations/components/form/error-message.d.ts +0 -22
- package/declarations/components/form/field.d.ts +0 -21
- package/declarations/components/form/form.d.ts +0 -14
- package/declarations/components/form/help-text.d.ts +0 -14
- package/declarations/components/form/index.d.ts +0 -15
- package/declarations/components/form/input.d.ts +0 -80
- package/declarations/components/form/label.d.ts +0 -34
- package/declarations/components/form/radio-group.d.ts +0 -43
- package/declarations/components/form/radio.d.ts +0 -54
- package/declarations/components/form/search-input.d.ts +0 -35
- package/declarations/components/form/select.d.ts +0 -36
- package/declarations/components/form/test.d.ts +0 -11
- package/declarations/components/form/textarea.d.ts +0 -79
- package/declarations/components/form/toggle.d.ts +0 -23
- package/declarations/components/primitives/grid-item.d.ts +0 -21
- package/declarations/components/primitives/grid.d.ts +0 -49
- package/declarations/components/primitives/h-stack.d.ts +0 -17
- package/declarations/components/primitives/heading.d.ts +0 -52
- package/declarations/components/primitives/image.d.ts +0 -24
- package/declarations/components/primitives/index.d.ts +0 -8
- package/declarations/components/primitives/link.d.ts +0 -16
- package/declarations/components/primitives/stack.d.ts +0 -23
- package/declarations/components/primitives/text.d.ts +0 -50
- package/declarations/components/primitives/v-stack.d.ts +0 -16
- package/declarations/components/ui/badge.d.ts +0 -14
- package/declarations/components/ui/button.d.ts +0 -32
- package/declarations/components/ui/card.d.ts +0 -27
- package/declarations/components/ui/description-list.d.ts +0 -22
- package/declarations/components/ui/drawer.d.ts +0 -14
- package/declarations/components/ui/icon-button.d.ts +0 -21
- package/declarations/components/ui/icon.d.ts +0 -21
- package/declarations/components/ui/index.d.ts +0 -17
- package/declarations/components/ui/modal.d.ts +0 -14
- package/declarations/components/ui/page-header.d.ts +0 -16
- package/declarations/components/ui/skeleton-card.d.ts +0 -17
- package/declarations/components/ui/skeleton-text.d.ts +0 -16
- package/declarations/components/ui/skeleton.d.ts +0 -20
- package/declarations/components/ui/spinner.d.ts +0 -11
- package/declarations/components/ui/tab-nav/index.d.ts +0 -36
- package/declarations/components/ui/table/body.d.ts +0 -11
- package/declarations/components/ui/table/caption.d.ts +0 -18
- package/declarations/components/ui/table/cell.d.ts +0 -31
- package/declarations/components/ui/table/footer.d.ts +0 -11
- package/declarations/components/ui/table/header-cell.d.ts +0 -35
- package/declarations/components/ui/table/header.d.ts +0 -11
- package/declarations/components/ui/table/row.d.ts +0 -21
- package/declarations/components/ui/table_old.d.ts +0 -29
- package/declarations/data/index.d.ts +1 -0
- package/declarations/data/index.d.ts.map +1 -1
- package/declarations/data/sortable-list.d.ts +33 -0
- package/declarations/data/sortable-list.d.ts.map +1 -0
- package/declarations/data/table.d.ts +0 -1
- package/declarations/data/table.d.ts.map +1 -1
- package/declarations/form/calendar.d.ts +0 -1
- package/declarations/form/calendar.d.ts.map +1 -1
- package/declarations/form/control.d.ts +5 -1
- package/declarations/form/control.d.ts.map +1 -1
- package/declarations/form/country-select-field.d.ts +6 -0
- package/declarations/form/country-select-field.d.ts.map +1 -1
- package/declarations/form/country-select.d.ts +0 -1
- package/declarations/form/country-select.d.ts.map +1 -1
- package/declarations/form/date-picker-field.d.ts +6 -0
- package/declarations/form/date-picker-field.d.ts.map +1 -1
- package/declarations/form/date-picker.d.ts +0 -1
- package/declarations/form/date-picker.d.ts.map +1 -1
- package/declarations/form/date-range-picker-field.d.ts +6 -0
- package/declarations/form/date-range-picker-field.d.ts.map +1 -1
- package/declarations/form/date-range-picker.d.ts +0 -1
- package/declarations/form/date-range-picker.d.ts.map +1 -1
- package/declarations/form/fieldset.d.ts +22 -0
- package/declarations/form/fieldset.d.ts.map +1 -0
- package/declarations/form/form.d.ts +0 -1
- package/declarations/form/form.d.ts.map +1 -1
- package/declarations/form/index.d.ts +1 -0
- package/declarations/form/index.d.ts.map +1 -1
- package/declarations/form/label.d.ts +4 -0
- package/declarations/form/label.d.ts.map +1 -1
- package/declarations/form/listbox.d.ts +0 -1
- package/declarations/form/listbox.d.ts.map +1 -1
- package/declarations/form/money-field.d.ts +6 -1
- package/declarations/form/money-field.d.ts.map +1 -1
- package/declarations/form/multi-select.d.ts +0 -1
- package/declarations/form/multi-select.d.ts.map +1 -1
- package/declarations/form/number-field.d.ts +9 -1
- package/declarations/form/number-field.d.ts.map +1 -1
- package/declarations/form/select-field.d.ts +4 -1
- package/declarations/form/select-field.d.ts.map +1 -1
- package/declarations/form/test.d.ts +0 -11
- package/declarations/form/text-field.d.ts +9 -0
- package/declarations/form/text-field.d.ts.map +1 -1
- package/declarations/form/time-picker-field.d.ts +6 -0
- package/declarations/form/time-picker-field.d.ts.map +1 -1
- package/declarations/form/time-picker.d.ts +0 -1
- package/declarations/form/time-picker.d.ts.map +1 -1
- package/declarations/form/toggle.d.ts +4 -0
- package/declarations/form/toggle.d.ts.map +1 -1
- package/declarations/layout/index.d.ts +1 -0
- package/declarations/layout/index.d.ts.map +1 -1
- package/declarations/layout/panel.d.ts +34 -0
- package/declarations/layout/panel.d.ts.map +1 -0
- package/declarations/layout/stack.d.ts +1 -1
- package/declarations/media/icon.d.ts +0 -1
- package/declarations/media/icon.d.ts.map +1 -1
- package/declarations/media/image.d.ts +1 -1
- package/declarations/overlay/blanket.d.ts +0 -1
- package/declarations/overlay/blanket.d.ts.map +1 -1
- package/declarations/overlay/drawer.d.ts +4 -1
- package/declarations/overlay/drawer.d.ts.map +1 -1
- package/declarations/overlay/modal.d.ts +0 -1
- package/declarations/overlay/modal.d.ts.map +1 -1
- package/declarations/overlay/popover.d.ts +0 -1
- package/declarations/overlay/popover.d.ts.map +1 -1
- package/declarations/overlay/toast.d.ts +0 -1
- package/declarations/overlay/toast.d.ts.map +1 -1
- package/declarations/overlay/tooltip.d.ts +0 -1
- package/declarations/overlay/tooltip.d.ts.map +1 -1
- package/declarations/primitives/grid-item.d.ts +0 -21
- package/declarations/primitives/grid.d.ts +0 -49
- package/declarations/primitives/h-stack.d.ts +0 -17
- package/declarations/primitives/heading.d.ts +0 -52
- package/declarations/primitives/image.d.ts +0 -24
- package/declarations/primitives/index.d.ts +0 -4
- package/declarations/primitives/link.d.ts +0 -16
- package/declarations/primitives/stack.d.ts +0 -23
- package/declarations/primitives/text.d.ts +0 -50
- package/declarations/primitives/v-stack.d.ts +0 -16
- package/declarations/status/badge.d.ts +0 -1
- package/declarations/status/badge.d.ts.map +1 -1
- package/declarations/status/skeleton-avatar.d.ts +1 -1
- package/declarations/status/skeleton-avatar.d.ts.map +1 -1
- package/declarations/status/skeleton-button.d.ts +1 -1
- package/declarations/status/skeleton-button.d.ts.map +1 -1
- package/declarations/status/skeleton-image.d.ts +1 -1
- package/declarations/status/skeleton-image.d.ts.map +1 -1
- package/declarations/status/skeleton-text.d.ts +1 -1
- package/declarations/status/skeleton-text.d.ts.map +1 -1
- package/declarations/status/skeleton.d.ts +1 -1
- package/declarations/status/skeleton.d.ts.map +1 -1
- package/declarations/status/tag.d.ts +0 -1
- package/declarations/status/tag.d.ts.map +1 -1
- package/declarations/typography/link.d.ts +0 -16
- package/declarations/typography/text.d.ts +2 -0
- package/declarations/typography/text.d.ts.map +1 -1
- package/declarations/ui/button.d.ts +0 -50
- package/declarations/ui/icon.d.ts +0 -21
- package/dist/_app_/action/button-group.js +1 -0
- package/dist/_app_/data/sortable-list.js +1 -0
- package/dist/_app_/form/fieldset.js +1 -0
- package/dist/_app_/layout/panel.js +1 -0
- package/dist/action/button-group.css +18 -0
- package/dist/action/button-group.js +130 -0
- package/dist/action/button-group.js.map +1 -0
- package/dist/action/button.css +152 -0
- package/dist/action/button.js +1 -1
- package/dist/action/index.js +1 -0
- package/dist/action/index.js.map +1 -1
- package/dist/data/index.js +1 -0
- package/dist/data/index.js.map +1 -1
- package/dist/data/sortable-list-css-211fcfeedc08052ccbac7f51549ce0b1.css +89 -0
- package/dist/data/sortable-list.js +62 -0
- package/dist/data/sortable-list.js.map +1 -0
- package/dist/data/table.css +50 -49
- package/dist/data/table.js +1 -1
- package/dist/form/checkbox.css +3 -3
- package/dist/form/control-css-02e93d930aecac651d5c69dc10a83504.css +36 -0
- package/dist/form/control.js +2 -2
- package/dist/form/country-select-field.js +1 -1
- package/dist/form/country-select-field.js.map +1 -1
- package/dist/form/country-select.css +1 -1
- package/dist/form/date-picker-field.js +1 -1
- package/dist/form/date-picker-field.js.map +1 -1
- package/dist/form/date-range-picker-field.js +1 -1
- package/dist/form/date-range-picker-field.js.map +1 -1
- package/dist/form/field.css +3 -3
- package/dist/form/fieldset.css +65 -0
- package/dist/form/fieldset.js +20 -0
- package/dist/form/fieldset.js.map +1 -0
- package/dist/form/help-text.css +1 -1
- package/dist/form/index.js +1 -0
- package/dist/form/index.js.map +1 -1
- package/dist/form/input.css +1 -0
- package/dist/form/label.css +15 -1
- package/dist/form/label.js +10 -4
- package/dist/form/money-field.js +1 -1
- package/dist/form/multi-select.css +1 -1
- package/dist/form/number-field.css +1 -0
- package/dist/form/number-field.js +1 -1
- package/dist/form/radio.css +3 -3
- package/dist/form/select-field.js +1 -1
- package/dist/form/select-field.js.map +1 -1
- package/dist/form/select.css +1 -1
- package/dist/form/{text-field-css-f60360f3f8aaf4da664eaccd1bcc9f8f.css → text-field-css-754feeb82dbd9fc9afdc1f00dceb13ad.css} +22 -1
- package/dist/form/text-field.js +2 -2
- package/dist/form/textarea.css +2 -1
- package/dist/form/time-picker-field.js +1 -1
- package/dist/form/time-picker-field.js.map +1 -1
- package/dist/form/toggle.css +27 -1
- package/dist/form/toggle.js +4 -1
- package/dist/layout/{divider-css-1ba104b9c606cbd1f542b45640fb5f2b.css → divider-css-7e0cc7d350e31172582851c6cb2cf586.css} +2 -2
- package/dist/layout/divider.js +1 -1
- package/dist/layout/{grid-css-086976eb41686e3714554f56c098d3d5.css → grid-css-c8259b34d7062f44e78f0a2cc139cb44.css} +13 -13
- package/dist/layout/grid.js +1 -1
- package/dist/layout/index.js +1 -0
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/panel.css +229 -0
- package/dist/layout/panel.js +32 -0
- package/dist/layout/panel.js.map +1 -0
- package/dist/overlay/blanket.css +12 -11
- package/dist/overlay/blanket.js +1 -1
- package/dist/overlay/drawer.css +99 -62
- package/dist/overlay/drawer.js +7 -4
- package/dist/overlay/modal.css +22 -21
- package/dist/overlay/modal.js +4 -4
- package/dist/overlay/popover.css +30 -29
- package/dist/overlay/popover.js +4 -4
- package/dist/overlay/toast.css +49 -48
- package/dist/overlay/toast.js +2 -2
- package/dist/overlay/tooltip.css +38 -37
- package/dist/overlay/tooltip.js +2 -2
- package/dist/skeleton-shared-BTA5oAjw.js +3 -0
- package/dist/skeleton-shared-BTA5oAjw.js.map +1 -0
- package/dist/status/badge.css +30 -29
- package/dist/status/badge.js +1 -1
- package/dist/status/skeleton-avatar.js +1 -1
- package/dist/status/skeleton-avatar.js.map +1 -1
- package/dist/status/skeleton-button.js +1 -1
- package/dist/status/skeleton-button.js.map +1 -1
- package/dist/status/skeleton-image.js +1 -1
- package/dist/status/skeleton-image.js.map +1 -1
- package/dist/status/skeleton-text.js +1 -1
- package/dist/status/skeleton-text.js.map +1 -1
- package/dist/status/skeleton.js +1 -1
- package/dist/status/skeleton.js.map +1 -1
- package/dist/status/tag.css +50 -51
- package/dist/status/tag.js +1 -1
- package/dist/styles/base/typography.css +1 -1
- package/dist/styles/primitive/typography.css +10 -7
- package/dist/styles/semantic/typography.css +4 -4
- package/dist/styles.css +15 -12
- package/dist/typography/{heading-css-8850735eabc2efb34f15240b852c99e7.css → heading-css-726c4c3109f2b741657733e1ba103c67.css} +9 -9
- package/dist/typography/heading.js +1 -1
- package/dist/typography/{text-css-73e03f1b750b32d7064d4ef87562289c.css → text-css-935f55e9cd74b06a5ce61330c4c79ef9.css} +6 -1
- package/dist/typography/text.js +5 -2
- package/package.json +26 -19
- package/dist/form/control-css-6c81caf37fd813b36033091d5340bc70.css +0 -20
- package/dist/skeleton-CL5Pcwrk.js +0 -3
- package/dist/skeleton-CL5Pcwrk.js.map +0 -1
- /package/dist/status/{skeleton.css → skeleton-shared.css} +0 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import "./button-group.css"
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import { on } from '@ember/modifier';
|
|
6
|
+
import { fn, hash } from '@ember/helper';
|
|
7
|
+
import Button from './button.js';
|
|
8
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
9
|
+
import { setComponentTemplate } from '@ember/component';
|
|
10
|
+
import { g, i, n } from 'decorator-transforms/runtime';
|
|
11
|
+
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
class ButtonGroup extends Component {
|
|
15
|
+
static {
|
|
16
|
+
g(this.prototype, "internalValue", [tracked]);
|
|
17
|
+
}
|
|
18
|
+
#internalValue = (i(this, "internalValue"), void 0);
|
|
19
|
+
constructor(owner, args) {
|
|
20
|
+
super(owner, args);
|
|
21
|
+
const defaultVal = args.defaultValue;
|
|
22
|
+
if (this.selectionType === 'multiple') {
|
|
23
|
+
this.internalValue = Array.isArray(defaultVal) ? [...defaultVal] : defaultVal ? [defaultVal] : [];
|
|
24
|
+
} else {
|
|
25
|
+
this.internalValue = Array.isArray(defaultVal) ? defaultVal[0] ?? '' : defaultVal ?? '';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
get selectionType() {
|
|
29
|
+
return this.args.type ?? 'single';
|
|
30
|
+
}
|
|
31
|
+
get isControlled() {
|
|
32
|
+
return this.args.value !== undefined;
|
|
33
|
+
}
|
|
34
|
+
get selectedValue() {
|
|
35
|
+
return this.isControlled ? this.args.value ?? '' : this.internalValue;
|
|
36
|
+
}
|
|
37
|
+
get variant() {
|
|
38
|
+
return this.args.variant ?? 'outline';
|
|
39
|
+
}
|
|
40
|
+
get tone() {
|
|
41
|
+
return this.args.tone ?? 'neutral';
|
|
42
|
+
}
|
|
43
|
+
get size() {
|
|
44
|
+
return this.args.size ?? 'md';
|
|
45
|
+
}
|
|
46
|
+
get normalizedOptions() {
|
|
47
|
+
if (!this.args.options) return [];
|
|
48
|
+
return this.args.options.map(option => {
|
|
49
|
+
if (typeof option === 'string') {
|
|
50
|
+
return {
|
|
51
|
+
value: option,
|
|
52
|
+
label: option
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return option;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
isValueSelected = value => {
|
|
59
|
+
if (this.selectionType === 'multiple') {
|
|
60
|
+
const selected = this.selectedValue;
|
|
61
|
+
return Array.isArray(selected) ? selected.includes(value) : selected === value;
|
|
62
|
+
}
|
|
63
|
+
return this.selectedValue === value;
|
|
64
|
+
};
|
|
65
|
+
isFirst = index => index === 0;
|
|
66
|
+
isLast = index => index === this.normalizedOptions.length - 1;
|
|
67
|
+
handleSelect(value) {
|
|
68
|
+
if (this.selectionType === 'multiple') {
|
|
69
|
+
const current = this.selectedValue;
|
|
70
|
+
const currentArray = Array.isArray(current) ? current : [current];
|
|
71
|
+
let newValues;
|
|
72
|
+
if (currentArray.includes(value)) {
|
|
73
|
+
newValues = currentArray.filter(v => v !== value);
|
|
74
|
+
} else {
|
|
75
|
+
newValues = [...currentArray, value];
|
|
76
|
+
}
|
|
77
|
+
if (!this.isControlled) {
|
|
78
|
+
this.internalValue = newValues;
|
|
79
|
+
}
|
|
80
|
+
this.args.onChange?.(newValues);
|
|
81
|
+
} else {
|
|
82
|
+
if (this.selectedValue === value) return;
|
|
83
|
+
if (!this.isControlled) {
|
|
84
|
+
this.internalValue = value;
|
|
85
|
+
}
|
|
86
|
+
this.args.onChange?.(value);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
static {
|
|
90
|
+
n(this.prototype, "handleSelect", [action]);
|
|
91
|
+
}
|
|
92
|
+
static {
|
|
93
|
+
setComponentTemplate(precompileTemplate("<div class=\"button-group_e47b39f9a\" role=\"group\" aria-label={{@aria-label}} data-full-width={{if @isFullWidth \"true\"}} data-test-button-group ...attributes>\n {{#if (has-block)}}\n {{yield (hash Item=(component ButtonGroupItem groupVariant=this.variant groupTone=this.tone groupSize=this.size groupDisabled=@isDisabled groupFullWidth=@isFullWidth isValueSelected=this.isValueSelected onItemClick=this.handleSelect))}}\n {{else}}\n {{#each this.normalizedOptions as |option index|}}\n <Button @variant={{this.variant}} @tone={{this.tone}} @size={{this.size}} @isPressed={{this.isValueSelected option.value}} @isDisabled={{if @isDisabled true option.disabled}} @isFullWidth={{@isFullWidth}} @joinLeft={{if (this.isFirst index) false true}} @joinRight={{if (this.isLast index) false true}} {{on \"click\" (fn this.handleSelect option.value)}}>\n {{option.label}}\n </Button>\n {{/each}}\n {{/if}}\n</div>", {
|
|
94
|
+
strictMode: true,
|
|
95
|
+
scope: () => ({
|
|
96
|
+
hash,
|
|
97
|
+
ButtonGroupItem,
|
|
98
|
+
Button,
|
|
99
|
+
on,
|
|
100
|
+
fn
|
|
101
|
+
})
|
|
102
|
+
}), this);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
class ButtonGroupItem extends Component {
|
|
106
|
+
get isDisabled() {
|
|
107
|
+
return this.args.isDisabled ?? this.args.groupDisabled ?? false;
|
|
108
|
+
}
|
|
109
|
+
get isPressed() {
|
|
110
|
+
return this.args.isValueSelected(this.args.value);
|
|
111
|
+
}
|
|
112
|
+
handleClick() {
|
|
113
|
+
this.args.onItemClick(this.args.value);
|
|
114
|
+
}
|
|
115
|
+
static {
|
|
116
|
+
n(this.prototype, "handleClick", [action]);
|
|
117
|
+
}
|
|
118
|
+
static {
|
|
119
|
+
setComponentTemplate(precompileTemplate("<Button @variant={{@groupVariant}} @tone={{@groupTone}} @size={{@groupSize}} @isPressed={{this.isPressed}} @isDisabled={{this.isDisabled}} @isFullWidth={{@groupFullWidth}} @joinLeft={{@joinLeft}} @joinRight={{@joinRight}} {{on \"click\" this.handleClick}} ...attributes>\n {{yield}}\n</Button>", {
|
|
120
|
+
strictMode: true,
|
|
121
|
+
scope: () => ({
|
|
122
|
+
Button,
|
|
123
|
+
on
|
|
124
|
+
})
|
|
125
|
+
}), this);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { ButtonGroup as default };
|
|
130
|
+
//# sourceMappingURL=button-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-group.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/action/button.css
CHANGED
|
@@ -358,3 +358,155 @@
|
|
|
358
358
|
transform: rotate(360deg);
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
+
|
|
362
|
+
/* ===================================
|
|
363
|
+
* Pressed State (Outline variant)
|
|
364
|
+
* =================================== */
|
|
365
|
+
|
|
366
|
+
/* Neutral */
|
|
367
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="outline"][data-tone="neutral"],
|
|
368
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="solid"][data-tone="neutral"] {
|
|
369
|
+
background: var(--color-bg-fill-neutral);
|
|
370
|
+
color: var(--color-text-on-neutral);
|
|
371
|
+
border-color: var(--color-bg-fill-neutral);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="outline"][data-tone="neutral"]:hover:not(
|
|
375
|
+
:disabled
|
|
376
|
+
),
|
|
377
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="solid"][data-tone="neutral"]:hover:not(
|
|
378
|
+
:disabled
|
|
379
|
+
) {
|
|
380
|
+
background: var(--color-bg-fill-neutral-hover);
|
|
381
|
+
border-color: var(--color-bg-fill-neutral-hover);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="outline"][data-tone="neutral"]:active:not(
|
|
385
|
+
:disabled
|
|
386
|
+
),
|
|
387
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="solid"][data-tone="neutral"]:active:not(
|
|
388
|
+
:disabled
|
|
389
|
+
) {
|
|
390
|
+
background: var(--color-bg-fill-neutral-active);
|
|
391
|
+
border-color: var(--color-bg-fill-neutral-active);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/* Primary */
|
|
395
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="outline"][data-tone="primary"],
|
|
396
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="solid"][data-tone="primary"] {
|
|
397
|
+
background: var(--color-bg-fill-primary);
|
|
398
|
+
color: var(--color-text-on-primary);
|
|
399
|
+
border-color: var(--color-bg-fill-primary);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="outline"][data-tone="primary"]:hover:not(
|
|
403
|
+
:disabled
|
|
404
|
+
),
|
|
405
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="solid"][data-tone="primary"]:hover:not(
|
|
406
|
+
:disabled
|
|
407
|
+
) {
|
|
408
|
+
background: var(--color-bg-fill-primary-hover);
|
|
409
|
+
border-color: var(--color-bg-fill-primary-hover);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="outline"][data-tone="primary"]:active:not(
|
|
413
|
+
:disabled
|
|
414
|
+
),
|
|
415
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="solid"][data-tone="primary"]:active:not(
|
|
416
|
+
:disabled
|
|
417
|
+
) {
|
|
418
|
+
background: var(--color-bg-fill-primary-active);
|
|
419
|
+
border-color: var(--color-bg-fill-primary-active);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* Critical */
|
|
423
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="outline"][data-tone="critical"],
|
|
424
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="solid"][data-tone="critical"] {
|
|
425
|
+
background: var(--color-bg-fill-critical);
|
|
426
|
+
color: var(--color-text-on-critical);
|
|
427
|
+
border-color: var(--color-bg-fill-critical);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="outline"][data-tone="critical"]:hover:not(
|
|
431
|
+
:disabled
|
|
432
|
+
),
|
|
433
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="solid"][data-tone="critical"]:hover:not(
|
|
434
|
+
:disabled
|
|
435
|
+
) {
|
|
436
|
+
background: var(--color-bg-fill-critical-hover);
|
|
437
|
+
border-color: var(--color-bg-fill-critical-hover);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="outline"][data-tone="critical"]:active:not(
|
|
441
|
+
:disabled
|
|
442
|
+
),
|
|
443
|
+
.button_e0e07a6eb[data-pressed="true"][data-variant="solid"][data-tone="critical"]:active:not(
|
|
444
|
+
:disabled
|
|
445
|
+
) {
|
|
446
|
+
background: var(--color-bg-fill-critical-active);
|
|
447
|
+
border-color: var(--color-bg-fill-critical-active);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/* ===================================
|
|
451
|
+
* Join (joinLeft / joinRight)
|
|
452
|
+
* =================================== */
|
|
453
|
+
|
|
454
|
+
.button_e0e07a6eb[data-join-left="true"] {
|
|
455
|
+
border-top-left-radius: 0;
|
|
456
|
+
border-bottom-left-radius: 0;
|
|
457
|
+
margin-left: -1px;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.button_e0e07a6eb[data-join-right="true"] {
|
|
461
|
+
border-top-right-radius: 0;
|
|
462
|
+
border-bottom-right-radius: 0;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/* Instant feedback for joined buttons (e.g. segmented groups) */
|
|
466
|
+
.button_e0e07a6eb[data-join-left="true"],
|
|
467
|
+
.button_e0e07a6eb[data-join-right="true"] {
|
|
468
|
+
transition: none;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/* Prevent border-color shift on hover for joined neutral buttons */
|
|
472
|
+
.button_e0e07a6eb[data-join-left="true"][data-variant="outline"][data-tone="neutral"]:hover:not(
|
|
473
|
+
:disabled
|
|
474
|
+
),
|
|
475
|
+
.button_e0e07a6eb[data-join-right="true"][data-variant="outline"][data-tone="neutral"]:hover:not(
|
|
476
|
+
:disabled
|
|
477
|
+
),
|
|
478
|
+
.button_e0e07a6eb[data-join-left="true"][data-variant="outline"][data-tone="neutral"]:active:not(
|
|
479
|
+
:disabled
|
|
480
|
+
),
|
|
481
|
+
.button_e0e07a6eb[data-join-right="true"][data-variant="outline"][data-tone="neutral"]:active:not(
|
|
482
|
+
:disabled
|
|
483
|
+
) {
|
|
484
|
+
border-color: var(--color-border-neutral);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.button_e0e07a6eb[data-join-left="true"][data-variant="solid"][data-tone="neutral"]:hover:not(
|
|
488
|
+
:disabled
|
|
489
|
+
),
|
|
490
|
+
.button_e0e07a6eb[data-join-right="true"][data-variant="solid"][data-tone="neutral"]:hover:not(
|
|
491
|
+
:disabled
|
|
492
|
+
),
|
|
493
|
+
.button_e0e07a6eb[data-join-left="true"][data-variant="solid"][data-tone="neutral"]:active:not(
|
|
494
|
+
:disabled
|
|
495
|
+
),
|
|
496
|
+
.button_e0e07a6eb[data-join-right="true"][data-variant="solid"][data-tone="neutral"]:active:not(
|
|
497
|
+
:disabled
|
|
498
|
+
) {
|
|
499
|
+
border-color: var(--color-border-control);
|
|
500
|
+
box-shadow: none;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/* Ensure active/focused joined button appears above neighbors */
|
|
504
|
+
.button_e0e07a6eb[data-join-left="true"]:hover,
|
|
505
|
+
.button_e0e07a6eb[data-join-right="true"]:hover,
|
|
506
|
+
.button_e0e07a6eb[data-join-left="true"]:focus-visible,
|
|
507
|
+
.button_e0e07a6eb[data-join-right="true"]:focus-visible,
|
|
508
|
+
.button_e0e07a6eb[data-join-left="true"][data-pressed="true"],
|
|
509
|
+
.button_e0e07a6eb[data-join-right="true"][data-pressed="true"] {
|
|
510
|
+
z-index: 1;
|
|
511
|
+
position: relative;
|
|
512
|
+
}
|
package/dist/action/button.js
CHANGED
|
@@ -37,7 +37,7 @@ class Button extends Component {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
static {
|
|
40
|
-
setComponentTemplate(precompileTemplate("{{#if this.isLink}}\n <a class=\"button_e0e07a6eb\" href={{@href}} target={{@target}} aria-label={{@aria-label}} aria-busy={{if @isLoading \"true\"}} data-variant={{this.variant}} data-tone={{this.tone}} data-size={{this.size}} data-loading={{if @isLoading \"true\"}} data-disabled={{if this.isDisabledOrLoading \"true\"}} data-full-width={{if @isFullWidth \"true\"}} data-icon-only={{if (has-block) \"false\" \"true\"}} data-pressed={{this.ariaPressed}} data-test-button {{on \"click\" this.handleLinkClick}} ...attributes>\n {{#if @isLoading}}\n <span class=\"button-spinner_e0e07a6eb\" data-test-button-spinner></span>\n {{/if}}\n {{#if (has-block \"prefix\")}}\n <span class=\"button-prefix_e0e07a6eb\" data-test-button-prefix>\n {{yield to=\"prefix\"}}\n </span>\n {{/if}}\n <span class=\"button-label_e0e07a6eb\">\n {{#if @isLoading}}\n {{#if @loadingText}}\n {{@loadingText}}\n {{else}}\n {{yield}}\n {{/if}}\n {{else}}\n {{yield}}\n {{/if}}\n </span>\n {{#if (has-block \"suffix\")}}\n <span class=\"button-suffix_e0e07a6eb\" data-test-button-suffix>\n {{yield to=\"suffix\"}}\n </span>\n {{/if}}\n </a>\n{{else}}\n <button class=\"button_e0e07a6eb\" type={{this.buttonType}} disabled={{this.isDisabledOrLoading}} aria-label={{@aria-label}} aria-busy={{if @isLoading \"true\"}} aria-pressed={{this.ariaPressed}} data-variant={{this.variant}} data-tone={{this.tone}} data-size={{this.size}} data-loading={{if @isLoading \"true\"}} data-disabled={{if @isDisabled \"true\"}} data-full-width={{if @isFullWidth \"true\"}} data-icon-only={{if (has-block) \"false\" \"true\"}} data-pressed={{this.ariaPressed}} data-test-button ...attributes>\n {{#if @isLoading}}\n <span class=\"button-spinner_e0e07a6eb\" data-test-button-spinner></span>\n {{/if}}\n {{#if (has-block \"prefix\")}}\n <span class=\"button-prefix_e0e07a6eb\" data-test-button-prefix>\n {{yield to=\"prefix\"}}\n </span>\n {{/if}}\n <span class=\"button-label_e0e07a6eb\">\n {{#if @isLoading}}\n {{#if @loadingText}}\n {{@loadingText}}\n {{else}}\n {{yield}}\n {{/if}}\n {{else}}\n {{yield}}\n {{/if}}\n </span>\n {{#if (has-block \"suffix\")}}\n <span class=\"button-suffix_e0e07a6eb\" data-test-button-suffix>\n {{yield to=\"suffix\"}}\n </span>\n {{/if}}\n </button>\n{{/if}}", {
|
|
40
|
+
setComponentTemplate(precompileTemplate("{{#if this.isLink}}\n <a class=\"button_e0e07a6eb\" href={{@href}} target={{@target}} aria-label={{@aria-label}} aria-busy={{if @isLoading \"true\"}} data-variant={{this.variant}} data-tone={{this.tone}} data-size={{this.size}} data-loading={{if @isLoading \"true\"}} data-disabled={{if this.isDisabledOrLoading \"true\"}} data-full-width={{if @isFullWidth \"true\"}} data-icon-only={{if (has-block) \"false\" \"true\"}} data-pressed={{this.ariaPressed}} data-join-left={{if @joinLeft \"true\"}} data-join-right={{if @joinRight \"true\"}} data-test-button {{on \"click\" this.handleLinkClick}} ...attributes>\n {{#if @isLoading}}\n <span class=\"button-spinner_e0e07a6eb\" data-test-button-spinner></span>\n {{/if}}\n {{#if (has-block \"prefix\")}}\n <span class=\"button-prefix_e0e07a6eb\" data-test-button-prefix>\n {{yield to=\"prefix\"}}\n </span>\n {{/if}}\n <span class=\"button-label_e0e07a6eb\">\n {{#if @isLoading}}\n {{#if @loadingText}}\n {{@loadingText}}\n {{else}}\n {{yield}}\n {{/if}}\n {{else}}\n {{yield}}\n {{/if}}\n </span>\n {{#if (has-block \"suffix\")}}\n <span class=\"button-suffix_e0e07a6eb\" data-test-button-suffix>\n {{yield to=\"suffix\"}}\n </span>\n {{/if}}\n </a>\n{{else}}\n <button class=\"button_e0e07a6eb\" type={{this.buttonType}} disabled={{this.isDisabledOrLoading}} aria-label={{@aria-label}} aria-busy={{if @isLoading \"true\"}} aria-pressed={{this.ariaPressed}} data-variant={{this.variant}} data-tone={{this.tone}} data-size={{this.size}} data-loading={{if @isLoading \"true\"}} data-disabled={{if @isDisabled \"true\"}} data-full-width={{if @isFullWidth \"true\"}} data-icon-only={{if (has-block) \"false\" \"true\"}} data-pressed={{this.ariaPressed}} data-join-left={{if @joinLeft \"true\"}} data-join-right={{if @joinRight \"true\"}} data-test-button ...attributes>\n {{#if @isLoading}}\n <span class=\"button-spinner_e0e07a6eb\" data-test-button-spinner></span>\n {{/if}}\n {{#if (has-block \"prefix\")}}\n <span class=\"button-prefix_e0e07a6eb\" data-test-button-prefix>\n {{yield to=\"prefix\"}}\n </span>\n {{/if}}\n <span class=\"button-label_e0e07a6eb\">\n {{#if @isLoading}}\n {{#if @loadingText}}\n {{@loadingText}}\n {{else}}\n {{yield}}\n {{/if}}\n {{else}}\n {{yield}}\n {{/if}}\n </span>\n {{#if (has-block \"suffix\")}}\n <span class=\"button-suffix_e0e07a6eb\" data-test-button-suffix>\n {{yield to=\"suffix\"}}\n </span>\n {{/if}}\n </button>\n{{/if}}", {
|
|
41
41
|
strictMode: true,
|
|
42
42
|
scope: () => ({
|
|
43
43
|
on
|
package/dist/action/index.js
CHANGED
package/dist/action/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/data/index.js
CHANGED
package/dist/data/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* <inline>/src/data/sortable-list-css-211fcfeedc08052ccbac7f51549ce0b1.css */
|
|
2
|
+
|
|
3
|
+
.sortable-list_ebb0a8898 {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
background: var(--color-bg-surface);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.sortable-list_ebb0a8898[data-direction="horizontal"] {
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.sortable-item_ebb0a8898 {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: var(--spacing-3);
|
|
18
|
+
padding: var(--spacing-3) var(--spacing-4) var(--spacing-3) var(--spacing-10);
|
|
19
|
+
background: var(--color-bg-surface);
|
|
20
|
+
border: var(--border-width-1) solid var(--color-border-subtle);
|
|
21
|
+
border-radius: var(--radius-md);
|
|
22
|
+
user-select: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.sortable-item_ebb0a8898[data-disabled="true"] {
|
|
26
|
+
padding-left: var(--spacing-4);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Collapse borders between stacked items */
|
|
30
|
+
.sortable-item_ebb0a8898 + .sortable-item_ebb0a8898 {
|
|
31
|
+
margin-top: calc(-1 * var(--border-width-1));
|
|
32
|
+
border-top-left-radius: 0;
|
|
33
|
+
border-top-right-radius: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.sortable-item_ebb0a8898:has(+ .sortable-item_ebb0a8898) {
|
|
37
|
+
border-bottom-left-radius: 0;
|
|
38
|
+
border-bottom-right-radius: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.sortable-list_ebb0a8898[data-direction="horizontal"] .sortable-item_ebb0a8898 + .sortable-item_ebb0a8898 {
|
|
42
|
+
margin-top: 0;
|
|
43
|
+
margin-left: calc(-1 * var(--border-width-1));
|
|
44
|
+
border-top-left-radius: 0;
|
|
45
|
+
border-bottom-left-radius: 0;
|
|
46
|
+
border-top-right-radius: var(--radius-md);
|
|
47
|
+
border-bottom-right-radius: var(--radius-md);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.sortable-list_ebb0a8898[data-direction="horizontal"] .sortable-item_ebb0a8898:has(+ .sortable-item_ebb0a8898) {
|
|
51
|
+
border-top-right-radius: 0;
|
|
52
|
+
border-bottom-right-radius: 0;
|
|
53
|
+
border-top-left-radius: var(--radius-md);
|
|
54
|
+
border-bottom-left-radius: var(--radius-md);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.sortable-handle_ebb0a8898 {
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: 0;
|
|
60
|
+
left: 0;
|
|
61
|
+
bottom: 0;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
width: var(--spacing-10);
|
|
66
|
+
color: var(--color-text-tertiary);
|
|
67
|
+
cursor: grab;
|
|
68
|
+
transition:
|
|
69
|
+
color 0.15s ease,
|
|
70
|
+
background-color 0.15s ease;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.sortable-handle_ebb0a8898:hover {
|
|
74
|
+
color: var(--color-text);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.sortable-handle_ebb0a8898:active {
|
|
78
|
+
cursor: grabbing;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.sortable-list_ebb0a8898[data-disabled="true"] .sortable-handle_ebb0a8898 {
|
|
82
|
+
color: var(--color-text-disabled);
|
|
83
|
+
cursor: not-allowed;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.sortable-content_ebb0a8898 {
|
|
87
|
+
flex: 1;
|
|
88
|
+
min-width: 0;
|
|
89
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import "./sortable-list-css-211fcfeedc08052ccbac7f51549ce0b1.css"
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { hash } from '@ember/helper';
|
|
5
|
+
import { move, DragDrop } from '@arthur5005/dnd-kit-ember';
|
|
6
|
+
import Icon from '../media/icon.js';
|
|
7
|
+
import { GripVertical } from 'lucide';
|
|
8
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
9
|
+
import { setComponentTemplate } from '@ember/component';
|
|
10
|
+
import { g, i } from 'decorator-transforms/runtime';
|
|
11
|
+
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
// ============================================================================
|
|
15
|
+
// Component
|
|
16
|
+
// ============================================================================
|
|
17
|
+
class SortableList extends Component {
|
|
18
|
+
static {
|
|
19
|
+
g(this.prototype, "snapshot", [tracked], function () {
|
|
20
|
+
return [];
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
#snapshot = (i(this, "snapshot"), void 0);
|
|
24
|
+
get direction() {
|
|
25
|
+
return this.args.direction ?? 'vertical';
|
|
26
|
+
}
|
|
27
|
+
get isDisabled() {
|
|
28
|
+
return this.args.isDisabled ?? false;
|
|
29
|
+
}
|
|
30
|
+
get items() {
|
|
31
|
+
return this.args.items;
|
|
32
|
+
}
|
|
33
|
+
handleDragStart = () => {
|
|
34
|
+
this.snapshot = [...this.args.items];
|
|
35
|
+
};
|
|
36
|
+
handleDragOver = event => {
|
|
37
|
+
if (this.isDisabled) return;
|
|
38
|
+
// Cast needed: move() expects UniqueIdentifier[] but our items are generic T[]
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
const items = move(this.args.items, event);
|
|
41
|
+
this.args.onReorder(items);
|
|
42
|
+
};
|
|
43
|
+
handleDragEnd = event => {
|
|
44
|
+
if (event.canceled) {
|
|
45
|
+
this.args.onReorder([...this.snapshot]);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
static {
|
|
49
|
+
setComponentTemplate(precompileTemplate("\n\n<div class=\"sortable-list_ebb0a8898\" data-direction={{this.direction}} data-disabled={{if this.isDisabled \"true\"}} data-test-sortable-list ...attributes>\n <DragDrop @onDragStart={{this.handleDragStart}} @onDragOver={{this.handleDragOver}} @onDragEnd={{this.handleDragEnd}} as |dd|>\n {{#each this.items as |item index|}}\n {{#let (@key item) as |itemId|}}\n <div class=\"sortable-item_ebb0a8898\" data-disabled={{if this.isDisabled \"true\"}} data-test-sortable-item={{itemId}} {{dd.sortable id=itemId index=index disabled=this.isDisabled}}>\n {{#unless this.isDisabled}}\n <span class=\"sortable-handle_ebb0a8898\" role=\"button\" aria-label=\"Reorder item\" data-test-sortable-handle {{dd.handle id=itemId}}>\n <Icon @icon={{GripVertical}} @size=\"sm\" />\n </span>\n {{/unless}}\n <div class=\"sortable-content_ebb0a8898\">\n {{yield (hash item=item index=index)}}\n </div>\n </div>\n {{/let}}\n {{/each}}\n </DragDrop>\n</div>", {
|
|
50
|
+
strictMode: true,
|
|
51
|
+
scope: () => ({
|
|
52
|
+
DragDrop,
|
|
53
|
+
Icon,
|
|
54
|
+
GripVertical,
|
|
55
|
+
hash
|
|
56
|
+
})
|
|
57
|
+
}), this);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { SortableList as default };
|
|
62
|
+
//# sourceMappingURL=sortable-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortable-list.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|