@frontile/buttons 0.17.0-alpha.2 → 0.17.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/components/button-group.d.ts +25 -0
- package/declarations/components/button-group.d.ts.map +1 -0
- package/declarations/components/button.d.ts +9 -2
- package/declarations/components/button.d.ts.map +1 -1
- package/declarations/components/chip.d.ts +41 -40
- package/declarations/components/chip.d.ts.map +1 -1
- package/declarations/components/close-button.d.ts +39 -0
- package/declarations/components/close-button.d.ts.map +1 -0
- package/declarations/components/divider.d.ts +12 -0
- package/declarations/components/divider.d.ts.map +1 -0
- package/declarations/components/dropdown.d.ts +0 -0
- package/declarations/components/dropdown.d.ts.map +1 -0
- package/declarations/components/listbox/index.d.ts +0 -0
- package/declarations/components/listbox/item.d.ts +59 -0
- package/declarations/components/listbox/item.d.ts.map +1 -0
- package/declarations/components/listbox/listManager.d.ts +47 -0
- package/declarations/components/listbox/listManager.d.ts.map +1 -0
- package/declarations/components/listbox/listbox.d.ts +53 -0
- package/declarations/components/listbox/listbox.d.ts.map +1 -0
- package/declarations/components/listbox/setupListItemModfier.d.ts +22 -0
- package/declarations/components/listbox/setupListItemModfier.d.ts.map +1 -0
- package/declarations/components/listbox.d.ts +2 -0
- package/declarations/components/listbox.d.ts.map +1 -0
- package/declarations/components/progress-bar.d.ts +91 -0
- package/declarations/components/progress-bar.d.ts.map +1 -0
- package/declarations/components/toggle-button.d.ts +29 -0
- package/declarations/components/toggle-button.d.ts.map +1 -0
- package/declarations/index-no8en1_n.d.ts +67 -0
- package/declarations/index.d.ts +6 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/listbox-1cp2bD-x.d.ts +67 -0
- package/declarations/listbox-38xau2IA.d.ts +67 -0
- package/declarations/listbox-A_qc5w8r.d.ts +67 -0
- package/declarations/listbox-S1lgfwKX.d.ts +67 -0
- package/declarations/listbox-ZEReOm3F.d.ts +67 -0
- package/declarations/listbox-cAOcxqN8.d.ts +67 -0
- package/declarations/listbox-hhoUlBQR.d.ts +67 -0
- package/declarations/listbox-i1gEINAH.d.ts +67 -0
- package/declarations/listbox-lYENr0uH.d.ts +67 -0
- package/declarations/listbox-no8en1_n.d.ts +67 -0
- package/declarations/listbox-sAR1PFcv.d.ts +67 -0
- package/declarations/listbox-tZZ0yA07.d.ts +67 -0
- package/declarations/template-registry.d.ts +4 -2
- package/declarations/template-registry.d.ts.map +1 -1
- package/dist/_app_/components/button-group.js +1 -0
- package/dist/_app_/components/close-button.js +1 -0
- package/dist/_app_/components/toggle-button.js +1 -0
- package/dist/components/button-group.js +29 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.js +5 -6
- package/dist/components/button.js.map +1 -1
- package/dist/components/chip.js +5 -7
- package/dist/components/chip.js.map +1 -1
- package/dist/components/close-button.js +43 -0
- package/dist/components/close-button.js.map +1 -0
- package/dist/components/toggle-button.js +42 -0
- package/dist/components/toggle-button.js.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/package.json +23 -18
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Modifier from 'ember-modifier';
|
|
2
|
+
import { ArgsFor } from "ember-modifier";
|
|
3
|
+
type SelectionMode = "none" | "single" | "multiple";
|
|
4
|
+
declare class Node {
|
|
5
|
+
el: HTMLLIElement;
|
|
6
|
+
key: string;
|
|
7
|
+
textValue: string;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
constructor(el: HTMLLIElement, args: Required<NodeArgs>);
|
|
12
|
+
}
|
|
13
|
+
interface NodeArgs {
|
|
14
|
+
key: string;
|
|
15
|
+
textValue?: string;
|
|
16
|
+
isSelected?: boolean;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
isActive?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface ListManagerOptions {
|
|
21
|
+
selectionMode?: SelectionMode;
|
|
22
|
+
selectedKeys?: string[];
|
|
23
|
+
disabledKeys?: string[];
|
|
24
|
+
allowEmpty?: boolean;
|
|
25
|
+
onAction?: (key: string) => void;
|
|
26
|
+
onSelectionChange?: (key: string[]) => void;
|
|
27
|
+
}
|
|
28
|
+
declare class ListManager {
|
|
29
|
+
#private;
|
|
30
|
+
searchKeys: string;
|
|
31
|
+
constructor(options?: ListManagerOptions);
|
|
32
|
+
register(el: HTMLLIElement, args: Required<NodeArgs>): void;
|
|
33
|
+
unregister(el: HTMLLIElement): void;
|
|
34
|
+
at(el?: HTMLLIElement): Node | undefined;
|
|
35
|
+
update(options: ListManagerOptions): void;
|
|
36
|
+
selectActiveNode(): void;
|
|
37
|
+
selectNode(node?: Node): void;
|
|
38
|
+
activateNode(node?: Node): void;
|
|
39
|
+
setNextOptionActive(): void;
|
|
40
|
+
setPreviousOptionActive(): void;
|
|
41
|
+
setFirstOptionActive(): void;
|
|
42
|
+
setLastOptionActive(): void;
|
|
43
|
+
search(key: string): void;
|
|
44
|
+
isKeyDisabled(key: string): boolean;
|
|
45
|
+
isKeySelected(key: string): boolean;
|
|
46
|
+
}
|
|
47
|
+
interface SetupListItemModifierSignature {
|
|
48
|
+
Args: {
|
|
49
|
+
Positional: [manager: ListManager];
|
|
50
|
+
Named: Pick<NodeArgs, 'key' | 'textValue'>;
|
|
51
|
+
};
|
|
52
|
+
Element: HTMLLIElement;
|
|
53
|
+
}
|
|
54
|
+
declare class SetupListItem extends Modifier<SetupListItemModifierSignature> {
|
|
55
|
+
element?: HTMLLIElement;
|
|
56
|
+
manager?: ListManager;
|
|
57
|
+
/* eslint-disable-next-line */
|
|
58
|
+
constructor(owner: any, args: ArgsFor<SetupListItemModifierSignature>);
|
|
59
|
+
modify(element: HTMLLIElement, [manager]: [ListManager], args: ArgsFor<SetupListItemModifierSignature>['named']): void;
|
|
60
|
+
update: (args: ArgsFor<SetupListItemModifierSignature>['named']) => void;
|
|
61
|
+
register: (el: HTMLLIElement, manager: ListManager, args: ArgsFor<SetupListItemModifierSignature>['named']) => void;
|
|
62
|
+
unregister: (instance: SetupListItem) => void;
|
|
63
|
+
mouseEnter: () => void;
|
|
64
|
+
mouseLeave: () => void;
|
|
65
|
+
}
|
|
66
|
+
export type { Node, NodeArgs, SelectionMode };
|
|
67
|
+
export { ListManager, SetupListItem };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Modifier from 'ember-modifier';
|
|
2
|
+
import { ArgsFor } from "ember-modifier";
|
|
3
|
+
type SelectionMode = "none" | "single" | "multiple";
|
|
4
|
+
declare class Node {
|
|
5
|
+
el: HTMLLIElement;
|
|
6
|
+
key: string;
|
|
7
|
+
textValue: string;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
constructor(el: HTMLLIElement, args: Required<NodeArgs>);
|
|
12
|
+
}
|
|
13
|
+
interface NodeArgs {
|
|
14
|
+
key: string;
|
|
15
|
+
textValue?: string;
|
|
16
|
+
isSelected?: boolean;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
isActive?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface ListManagerOptions {
|
|
21
|
+
selectionMode?: SelectionMode;
|
|
22
|
+
selectedKeys?: string[];
|
|
23
|
+
disabledKeys?: string[];
|
|
24
|
+
allowEmpty?: boolean;
|
|
25
|
+
onAction?: (key: string) => void;
|
|
26
|
+
onSelectionChange?: (key: string[]) => void;
|
|
27
|
+
}
|
|
28
|
+
declare class ListManager {
|
|
29
|
+
#private;
|
|
30
|
+
searchKeys: string;
|
|
31
|
+
constructor(options?: ListManagerOptions);
|
|
32
|
+
register(el: HTMLLIElement, args: Required<NodeArgs>): void;
|
|
33
|
+
unregister(el: HTMLLIElement): void;
|
|
34
|
+
at(el?: HTMLLIElement): Node | undefined;
|
|
35
|
+
update(options: ListManagerOptions): void;
|
|
36
|
+
selectActiveNode(): void;
|
|
37
|
+
selectNode(node?: Node): void;
|
|
38
|
+
activateNode(node?: Node): void;
|
|
39
|
+
setNextOptionActive(): void;
|
|
40
|
+
setPreviousOptionActive(): void;
|
|
41
|
+
setFirstOptionActive(): void;
|
|
42
|
+
setLastOptionActive(): void;
|
|
43
|
+
search(key: string): void;
|
|
44
|
+
isKeyDisabled(key: string): boolean;
|
|
45
|
+
isKeySelected(key: string): boolean;
|
|
46
|
+
}
|
|
47
|
+
interface SetupListItemModifierSignature {
|
|
48
|
+
Args: {
|
|
49
|
+
Positional: [manager: ListManager];
|
|
50
|
+
Named: Pick<NodeArgs, 'key' | 'textValue'>;
|
|
51
|
+
};
|
|
52
|
+
Element: HTMLLIElement;
|
|
53
|
+
}
|
|
54
|
+
declare class SetupListItem extends Modifier<SetupListItemModifierSignature> {
|
|
55
|
+
element?: HTMLLIElement;
|
|
56
|
+
manager?: ListManager;
|
|
57
|
+
/* eslint-disable-next-line */
|
|
58
|
+
constructor(owner: any, args: ArgsFor<SetupListItemModifierSignature>);
|
|
59
|
+
modify(element: HTMLLIElement, [manager]: [ListManager], args: ArgsFor<SetupListItemModifierSignature>['named']): void;
|
|
60
|
+
update: (args: ArgsFor<SetupListItemModifierSignature>['named']) => void;
|
|
61
|
+
register: (el: HTMLLIElement, manager: ListManager, args: ArgsFor<SetupListItemModifierSignature>['named']) => void;
|
|
62
|
+
unregister: (instance: SetupListItem) => void;
|
|
63
|
+
mouseEnter: () => void;
|
|
64
|
+
mouseLeave: () => void;
|
|
65
|
+
}
|
|
66
|
+
export type { Node, NodeArgs, SelectionMode };
|
|
67
|
+
export { ListManager, SetupListItem };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Modifier from 'ember-modifier';
|
|
2
|
+
import { ArgsFor } from "ember-modifier";
|
|
3
|
+
type SelectionMode = "none" | "single" | "multiple";
|
|
4
|
+
declare class Node {
|
|
5
|
+
el: HTMLLIElement;
|
|
6
|
+
key: string;
|
|
7
|
+
textValue: string;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
constructor(el: HTMLLIElement, args: Required<NodeArgs>);
|
|
12
|
+
}
|
|
13
|
+
interface NodeArgs {
|
|
14
|
+
key: string;
|
|
15
|
+
textValue?: string;
|
|
16
|
+
isSelected?: boolean;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
isActive?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface ListManagerOptions {
|
|
21
|
+
selectionMode?: SelectionMode;
|
|
22
|
+
selectedKeys?: string[];
|
|
23
|
+
disabledKeys?: string[];
|
|
24
|
+
allowEmpty?: boolean;
|
|
25
|
+
onAction?: (key: string) => void;
|
|
26
|
+
onSelectionChange?: (key: string[]) => void;
|
|
27
|
+
}
|
|
28
|
+
declare class ListManager {
|
|
29
|
+
#private;
|
|
30
|
+
searchKeys: string;
|
|
31
|
+
constructor(options?: ListManagerOptions);
|
|
32
|
+
register(el: HTMLLIElement, args: Required<NodeArgs>): void;
|
|
33
|
+
unregister(el: HTMLLIElement): void;
|
|
34
|
+
at(el?: HTMLLIElement): Node | undefined;
|
|
35
|
+
update(options: ListManagerOptions): void;
|
|
36
|
+
selectActiveNode(): void;
|
|
37
|
+
selectNode(node?: Node): void;
|
|
38
|
+
activateNode(node?: Node): void;
|
|
39
|
+
setNextOptionActive(): void;
|
|
40
|
+
setPreviousOptionActive(): void;
|
|
41
|
+
setFirstOptionActive(): void;
|
|
42
|
+
setLastOptionActive(): void;
|
|
43
|
+
search(key: string): void;
|
|
44
|
+
isKeyDisabled(key: string): boolean;
|
|
45
|
+
isKeySelected(key: string): boolean;
|
|
46
|
+
}
|
|
47
|
+
interface SetupListItemModifierSignature {
|
|
48
|
+
Args: {
|
|
49
|
+
Positional: [manager: ListManager];
|
|
50
|
+
Named: Pick<NodeArgs, 'key' | 'textValue'>;
|
|
51
|
+
};
|
|
52
|
+
Element: HTMLLIElement;
|
|
53
|
+
}
|
|
54
|
+
declare class SetupListItem extends Modifier<SetupListItemModifierSignature> {
|
|
55
|
+
element?: HTMLLIElement;
|
|
56
|
+
manager?: ListManager;
|
|
57
|
+
/* eslint-disable-next-line */
|
|
58
|
+
constructor(owner: any, args: ArgsFor<SetupListItemModifierSignature>);
|
|
59
|
+
modify(element: HTMLLIElement, [manager]: [ListManager], args: ArgsFor<SetupListItemModifierSignature>['named']): void;
|
|
60
|
+
update: (args: ArgsFor<SetupListItemModifierSignature>['named']) => void;
|
|
61
|
+
register: (el: HTMLLIElement, manager: ListManager, args: ArgsFor<SetupListItemModifierSignature>['named']) => void;
|
|
62
|
+
unregister: (instance: SetupListItem) => void;
|
|
63
|
+
mouseEnter: () => void;
|
|
64
|
+
mouseLeave: () => void;
|
|
65
|
+
}
|
|
66
|
+
export type { Node, NodeArgs, SelectionMode };
|
|
67
|
+
export { ListManager, SetupListItem };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type Button from './
|
|
2
|
-
import type Chip from './components/chip';
|
|
1
|
+
import type { Button, ButtonGroup, Chip, CloseButton, ToggleButton } from './index';
|
|
3
2
|
export default interface Registry {
|
|
4
3
|
Button: typeof Button;
|
|
5
4
|
Chip: typeof Chip;
|
|
5
|
+
ToggleButton: typeof ToggleButton;
|
|
6
|
+
ButtonGroup: typeof ButtonGroup;
|
|
7
|
+
CloseButton: typeof CloseButton;
|
|
6
8
|
}
|
|
7
9
|
//# sourceMappingURL=template-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../src/template-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../src/template-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,IAAI,EACJ,WAAW,EACX,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,WAAW,QAAQ;IAC/B,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,WAAW,EAAE,OAAO,WAAW,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@frontile/buttons/components/button-group";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@frontile/buttons/components/close-button";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@frontile/buttons/components/toggle-button";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { hash } from '@ember/helper';
|
|
3
|
+
import { useStyles } from '@frontile/theme';
|
|
4
|
+
import { Button } from './button.js';
|
|
5
|
+
import { ToggleButton } from './toggle-button.js';
|
|
6
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
|
+
import { setComponentTemplate } from '@ember/component';
|
|
8
|
+
|
|
9
|
+
var _class;
|
|
10
|
+
let ButtonGroup = (_class = class ButtonGroup extends Component {
|
|
11
|
+
get classNames() {
|
|
12
|
+
const {
|
|
13
|
+
buttonGroup: buttonGroup1
|
|
14
|
+
} = useStyles();
|
|
15
|
+
return buttonGroup1({
|
|
16
|
+
class: this.args.class
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}, setComponentTemplate(precompileTemplate("\n <div class={{this.classNames}} role=\"group\" ...attributes>\n {{yield (hash Button=(component Button isInGroup=true appearance=@appearance intent=@intent size=@size) ToggleButton=(component ToggleButton isInGroup=true intent=@intent size=@size))}}\n </div>\n ", {
|
|
20
|
+
scope: () => ({
|
|
21
|
+
hash,
|
|
22
|
+
Button,
|
|
23
|
+
ToggleButton
|
|
24
|
+
}),
|
|
25
|
+
strictMode: true
|
|
26
|
+
}), _class), _class);
|
|
27
|
+
|
|
28
|
+
export { ButtonGroup, ButtonGroup as default };
|
|
29
|
+
//# sourceMappingURL=button-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-group.js","sources":["../../src/components/button-group.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport Button from './button';\nimport type { ButtonArgs } from './button';\nimport ToggleButton from './toggle-button';\nimport type { WithBoundArgs } from '@glint/template';\ninterface ButtonGroupArgs extends Pick<ButtonArgs, 'appearance' | 'intent' | 'size' | 'class'> {\n}\ninterface ButtonGroupSignature {\n Args: ButtonGroupArgs;\n Blocks: {\n default: [{\n Button: WithBoundArgs<typeof Button, 'isInGroup'>;\n ToggleButton: WithBoundArgs<typeof ToggleButton, 'isInGroup'>;\n }];\n };\n Element: HTMLDivElement;\n}\nlet ButtonGroup = class ButtonGroup extends Component<ButtonGroupSignature> {\n get classNames(): string {\n const { buttonGroup: buttonGroup1 } = useStyles();\n return buttonGroup1({\n class: this.args.class\n });\n }\n static{\n template(`\n <div class={{this.classNames}} role=\"group\" ...attributes>\n {{yield\n (hash\n Button=(component\n Button\n isInGroup=true\n appearance=@appearance\n intent=@intent\n size=@size\n )\n ToggleButton=(component\n ToggleButton isInGroup=true intent=@intent size=@size\n )\n )\n }}\n </div>\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n};\nexport { ButtonGroup, ButtonGroupSignature };\nexport default ButtonGroup;\n"],"names":["ButtonGroup","_class","Component","classNames","buttonGroup","buttonGroup1","useStyles","class","args","setComponentTemplate","precompileTemplate","scope","hash","Button","ToggleButton","strictMode"],"mappings":";;;;;;;;;AAoBIA,IAAAA,WAAW,IAAAC,MAAA,GAAG,MAAMD,WAAW,SAASE,SAAS,CAAuB;EACxE,IAAIC,UAAUA,GAAW;IACrB,MAAM;AAAEC,MAAAA,WAAW,EAAEC,YAAAA;KAAc,GAAGC,SAAS,EAAE,CAAA;AACjD,IAAA,OAAOD,YAAY,CAAC;AAChBE,MAAAA,KAAK,EAAE,IAAI,CAACC,IAAI,CAACD,KAAAA;AACrB,KAAC,CAAC,CAAA;AACN,GAAA;AA0BJ,CAAC,EAAAE,oBAAA,CAxBOC,kBAAA,CAiBH,qRAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,IAAA;IAAAC,MAAA;AAAAC,IAAAA,YAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAd,MAAA,CAAA,EAAAA,MAAA;;;;"}
|
|
@@ -5,7 +5,7 @@ import { precompileTemplate } from '@ember/template-compilation';
|
|
|
5
5
|
import { setComponentTemplate } from '@ember/component';
|
|
6
6
|
|
|
7
7
|
var _class;
|
|
8
|
-
class Button extends Component {
|
|
8
|
+
let Button = (_class = class Button extends Component {
|
|
9
9
|
get type() {
|
|
10
10
|
if (this.args.type) {
|
|
11
11
|
return this.args.type;
|
|
@@ -20,17 +20,16 @@ class Button extends Component {
|
|
|
20
20
|
intent: this.args.intent || 'default',
|
|
21
21
|
size: this.args.size,
|
|
22
22
|
appearance: this.args.appearance || 'default',
|
|
23
|
+
isInGroup: this.args.isInGroup,
|
|
23
24
|
class: this.args.class
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
|
-
}
|
|
27
|
-
_class = Button;
|
|
28
|
-
setComponentTemplate(precompileTemplate("\n {{#if @isRenderless}}\n {{yield (hash classNames=this.classNames)}}\n {{else}}\n <button type={{this.type}} class={{this.classNames}} ...attributes>\n {{yield (hash classNames=this.classNames)}}\n </button>\n {{/if}}\n ", {
|
|
27
|
+
}, setComponentTemplate(precompileTemplate("\n {{#if @isRenderless}}\n {{yield (hash classNames=this.classNames)}}\n {{else}}\n <button type={{this.type}} class={{this.classNames}} ...attributes>\n {{yield (hash classNames=this.classNames)}}\n </button>\n {{/if}}\n ", {
|
|
29
28
|
scope: () => ({
|
|
30
29
|
hash
|
|
31
30
|
}),
|
|
32
31
|
strictMode: true
|
|
33
|
-
}), _class);
|
|
32
|
+
}), _class), _class);
|
|
34
33
|
|
|
35
|
-
export { Button as default };
|
|
34
|
+
export { Button, Button as default };
|
|
36
35
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../src/components/button.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nexport interface ButtonArgs {\n /**\n * The HTML type of the button\n *\n * @defaultValue 'button'\n */ type?: 'button' | 'submit' | 'reset';\n /**\n * The button appearance\n *\n * @defaultValue 'default'\n */ appearance?: 'default' | 'outlined' | 'minimal' | 'custom';\n /**\n * The intent of the button\n */ intent?: 'default' | 'primary' | 'success' | 'warning' | 'danger';\n /**\n * The size of the button\n */ size?: 'xs' | 'sm' | 'lg' | 'xl';\n /**\n * Disable rendering the button element. It yields an object with classNames instead.\n */ isRenderless?: boolean;\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */ class?: string;\n}\
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../src/components/button.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nexport interface ButtonArgs {\n /**\n * The HTML type of the button\n *\n * @defaultValue 'button'\n */ type?: 'button' | 'submit' | 'reset';\n /**\n * The button appearance\n *\n * @defaultValue 'default'\n */ appearance?: 'default' | 'outlined' | 'minimal' | 'custom';\n /**\n * The intent of the button\n */ intent?: 'default' | 'primary' | 'success' | 'warning' | 'danger';\n /**\n * The size of the button\n */ size?: 'xs' | 'sm' | 'lg' | 'xl';\n /**\n * Disable rendering the button element. It yields an object with classNames instead.\n */ isRenderless?: boolean;\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */ class?: string;\n /**\n * If button is part of a group. Most of the time, this is automatically set\n * when using the ButtonGroup component.\n */ isInGroup?: boolean;\n}\ninterface ButtonSignature {\n Args: ButtonArgs;\n Blocks: {\n default: [{\n classNames: string;\n }];\n };\n Element: HTMLButtonElement;\n}\nlet Button = class Button extends Component<ButtonSignature> {\n get type(): string {\n if (this.args.type) {\n return this.args.type;\n }\n return 'button';\n }\n get classNames(): string {\n const { button: button1 } = useStyles();\n return button1({\n intent: this.args.intent || 'default',\n size: this.args.size,\n appearance: this.args.appearance || 'default',\n isInGroup: this.args.isInGroup,\n class: this.args.class\n });\n }\n static{\n template(`\n {{#if @isRenderless}}\n {{yield (hash classNames=this.classNames)}}\n {{else}}\n <button type={{this.type}} class={{this.classNames}} ...attributes>\n {{yield (hash classNames=this.classNames)}}\n </button>\n {{/if}}\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n};\nexport { Button, ButtonSignature };\nexport default Button;\n"],"names":["Button","_class","Component","type","args","classNames","button","button1","useStyles","intent","size","appearance","isInGroup","class","setComponentTemplate","precompileTemplate","scope","hash","strictMode"],"mappings":";;;;;;;AAyCIA,IAAAA,MAAM,IAAAC,MAAA,GAAG,MAAMD,MAAM,SAASE,SAAS,CAAkB;EACzD,IAAIC,IAAIA,GAAW;AACf,IAAA,IAAI,IAAI,CAACC,IAAI,CAACD,IAAI,EAAE;AAChB,MAAA,OAAO,IAAI,CAACC,IAAI,CAACD,IAAI,CAAA;AACzB,KAAA;AACA,IAAA,OAAO,QAAQ,CAAA;AACnB,GAAA;EACA,IAAIE,UAAUA,GAAW;IACrB,MAAM;AAAEC,MAAAA,MAAM,EAAEC,OAAAA;KAAS,GAAGC,SAAS,EAAE,CAAA;AACvC,IAAA,OAAOD,OAAO,CAAC;AACXE,MAAAA,MAAM,EAAE,IAAI,CAACL,IAAI,CAACK,MAAM,IAAI,SAAS;AACrCC,MAAAA,IAAI,EAAE,IAAI,CAACN,IAAI,CAACM,IAAI;AACpBC,MAAAA,UAAU,EAAE,IAAI,CAACP,IAAI,CAACO,UAAU,IAAI,SAAS;AAC7CC,MAAAA,SAAS,EAAE,IAAI,CAACR,IAAI,CAACQ,SAAS;AAC9BC,MAAAA,KAAK,EAAE,IAAI,CAACT,IAAI,CAACS,KAAAA;AACrB,KAAC,CAAC,CAAA;AACN,GAAA;AAiBJ,CAAC,EAAAC,oBAAA,CAfOC,kBAAA,CAQH,gQAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA,IAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAjB,MAAA,CAAA,EAAAA,MAAA;;;;"}
|
package/dist/components/chip.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { useStyles } from '@frontile/theme';
|
|
3
|
-
import CloseButton from '
|
|
3
|
+
import { CloseButton } from './close-button.js';
|
|
4
4
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
5
5
|
import { setComponentTemplate } from '@ember/component';
|
|
6
6
|
|
|
7
7
|
var _class;
|
|
8
|
-
class Chip extends Component {
|
|
8
|
+
let Chip = (_class = class Chip extends Component {
|
|
9
9
|
get classNames() {
|
|
10
10
|
const {
|
|
11
11
|
chip: chip1
|
|
@@ -31,14 +31,12 @@ class Chip extends Component {
|
|
|
31
31
|
closeButton: closeButton1()
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
}
|
|
35
|
-
_class = Chip;
|
|
36
|
-
setComponentTemplate(precompileTemplate("\n <div class={{this.classNames.base}} ...attributes>\n {{#if @withDot}}\n <span class={{this.classNames.dot}}></span>\n {{/if}}\n <span class={{this.classNames.content}}>\n {{yield}}\n </span>\n {{#if @onClose}}\n <CloseButton @class={{this.classNames.closeButton}} @onClick={{@onClose}} disabled={{@isDisabled}} />\n {{/if}}\n </div>\n ", {
|
|
34
|
+
}, setComponentTemplate(precompileTemplate("\n <div class={{this.classNames.base}} ...attributes>\n {{#if @withDot}}\n <span class={{this.classNames.dot}}></span>\n {{/if}}\n <span class={{this.classNames.content}}>\n {{yield}}\n </span>\n {{#if @onClose}}\n <CloseButton @class={{this.classNames.closeButton}} @onClick={{@onClose}} disabled={{@isDisabled}} />\n {{/if}}\n </div>\n ", {
|
|
37
35
|
scope: () => ({
|
|
38
36
|
CloseButton
|
|
39
37
|
}),
|
|
40
38
|
strictMode: true
|
|
41
|
-
}), _class);
|
|
39
|
+
}), _class), _class);
|
|
42
40
|
|
|
43
|
-
export { Chip as default };
|
|
41
|
+
export { Chip, Chip as default };
|
|
44
42
|
//# sourceMappingURL=chip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.js","sources":["../../src/components/chip.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport CloseButton from '
|
|
1
|
+
{"version":3,"file":"chip.js","sources":["../../src/components/chip.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { CloseButton } from './close-button';\ninterface ChipSignature {\n Args: {\n /**\n * The chip appearance\n *\n * @defaultValue 'default'\n */ appearance?: 'default' | 'outlined' | 'faded';\n /**\n * The intent of the chip\n */ intent?: 'default' | 'primary' | 'success' | 'warning' | 'danger';\n /**\n * The size of the chip\n */ size?: 'sm' | 'md' | 'lg';\n /**\n * The radius the chip\n */ radius?: 'none' | 'sm' | 'lg' | 'full';\n /**\n * Option to add dot to the chip\n */ withDot?: boolean;\n /**\n * Function to be called when clicking on the close button.\n * If you pass this argument, the close button will be visible.\n */ onClose?: () => void;\n /**\n * Disables the clip and disables the close button if any.\n */ isDisabled?: boolean;\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */ class?: string;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\nlet Chip = class Chip extends Component<ChipSignature> {\n get classNames() {\n const { chip: chip1 } = useStyles();\n const { base: base1, content: content1, dot: dot1, closeButton: closeButton1 } = chip1({\n intent: this.args.intent || 'default',\n size: this.args.size,\n appearance: this.args.appearance || 'default',\n radius: this.args.radius,\n isDisabled: this.args.isDisabled\n });\n return {\n base: base1({\n class: this.args.class\n }),\n content: content1(),\n dot: dot1(),\n closeButton: closeButton1()\n };\n }\n static{\n template(`\n <div class={{this.classNames.base}} ...attributes>\n {{#if @withDot}}\n <span class={{this.classNames.dot}}></span>\n {{/if}}\n <span class={{this.classNames.content}}>\n {{yield}}\n </span>\n {{#if @onClose}}\n <CloseButton\n @class={{this.classNames.closeButton}}\n @onClick={{@onClose}}\n disabled={{@isDisabled}}\n />\n {{/if}}\n </div>\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n};\nexport { Chip, ChipSignature };\nexport default Chip;\n"],"names":["Chip","_class","Component","classNames","chip","chip1","useStyles","base","base1","content","content1","dot","dot1","closeButton","closeButton1","intent","args","size","appearance","radius","isDisabled","class","setComponentTemplate","precompileTemplate","scope","CloseButton","strictMode"],"mappings":";;;;;;;AAuCIA,IAAAA,IAAI,IAAAC,MAAA,GAAG,MAAMD,IAAI,SAASE,SAAS,CAAgB;EACnD,IAAIC,UAAUA,GAAG;IACb,MAAM;AAAEC,MAAAA,IAAI,EAAEC,KAAAA;KAAO,GAAGC,SAAS,EAAE,CAAA;IACnC,MAAM;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,OAAO,EAAEC,QAAQ;AAAEC,MAAAA,GAAG,EAAEC,IAAI;AAAEC,MAAAA,WAAW,EAAEC,YAAAA;KAAc,GAAGT,KAAK,CAAC;AACnFU,MAAAA,MAAM,EAAE,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,SAAS;AACrCE,MAAAA,IAAI,EAAE,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,UAAU,EAAE,IAAI,CAACF,IAAI,CAACE,UAAU,IAAI,SAAS;AAC7CC,MAAAA,MAAM,EAAE,IAAI,CAACH,IAAI,CAACG,MAAM;AACxBC,MAAAA,UAAU,EAAE,IAAI,CAACJ,IAAI,CAACI,UAAAA;AAC1B,KAAC,CAAC,CAAA;IACF,OAAO;MACHb,IAAI,EAAEC,KAAK,CAAC;AACRa,QAAAA,KAAK,EAAE,IAAI,CAACL,IAAI,CAACK,KAAAA;AACrB,OAAC,CAAC;MACFZ,OAAO,EAAEC,QAAQ,EAAE;MACnBC,GAAG,EAAEC,IAAI,EAAE;MACXC,WAAW,EAAEC,YAAY,EAAC;KAC7B,CAAA;AACL,GAAA;AAyBJ,CAAC,EAAAQ,oBAAA,CAvBOC,kBAAA,CAgBH,8YAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA,WAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAzB,MAAA,CAAA,EAAAA,MAAA;;;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { action } from '@ember/object';
|
|
4
|
+
import { on } from '@ember/modifier';
|
|
5
|
+
import { VisuallyHidden } from '@frontile/utilities';
|
|
6
|
+
import { useStyles } from '@frontile/theme';
|
|
7
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
8
|
+
import { setComponentTemplate } from '@ember/component';
|
|
9
|
+
|
|
10
|
+
var _class, _class2;
|
|
11
|
+
let CloseButton = (_class = (_class2 = class CloseButton extends Component {
|
|
12
|
+
get classes() {
|
|
13
|
+
const {
|
|
14
|
+
closeButton: closeButton1
|
|
15
|
+
} = useStyles();
|
|
16
|
+
let {
|
|
17
|
+
base: base1,
|
|
18
|
+
icon: icon1
|
|
19
|
+
} = closeButton1({
|
|
20
|
+
size: this.args.size || 'md'
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
base: base1({
|
|
24
|
+
class: this.args.class
|
|
25
|
+
}),
|
|
26
|
+
icon: icon1()
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
handleClick(event1) {
|
|
30
|
+
if (typeof this.args.onClick === 'function') {
|
|
31
|
+
this.args.onClick(event1);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, setComponentTemplate(precompileTemplate("\n <button type=\"button\" class={{this.classes.base}} ...attributes {{on \"click\" this.handleClick}}>\n\n {{#if (has-block)}}\n {{yield this.classes.icon}}\n {{else}}\n <svg class={{this.classes.icon}} aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\"></path>\n </svg>\n {{/if}}\n\n <VisuallyHidden>\n {{if @title @title \"Close\"}}\n </VisuallyHidden>\n </button>\n ", {
|
|
35
|
+
scope: () => ({
|
|
36
|
+
on,
|
|
37
|
+
VisuallyHidden
|
|
38
|
+
}),
|
|
39
|
+
strictMode: true
|
|
40
|
+
}), _class2), _class2), (_applyDecoratedDescriptor(_class.prototype, "handleClick", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleClick"), _class.prototype)), _class);
|
|
41
|
+
|
|
42
|
+
export { CloseButton, CloseButton as default };
|
|
43
|
+
//# sourceMappingURL=close-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"close-button.js","sources":["../../src/components/close-button.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { VisuallyHidden } from '@frontile/utilities';\nimport { useStyles } from '@frontile/theme';\ninterface CloseButtonSignature {\n Args: {\n /**\n * The title of the close button\n *\n * @defaultValue 'Close'\n */ title?: string;\n /**\n * The icon size\n *\n * @defaultValue 'lg'\n */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /**\n * The function to call when button is clicked\n */ onClick?: (event: Event) => void;\n /**\n * Additional class for close button element\n */ class?: string;\n };\n Blocks: {\n default: [string | null];\n };\n Element: HTMLButtonElement;\n}\nlet CloseButton = class CloseButton extends Component<CloseButtonSignature> {\n get classes() {\n const { closeButton: closeButton1 } = useStyles();\n let { base: base1, icon: icon1 } = closeButton1({\n size: this.args.size || 'md'\n });\n return {\n base: base1({\n class: this.args.class\n }),\n icon: icon1()\n };\n }\n @action\n handleClick(event1: Event): void {\n if (typeof this.args.onClick === 'function') {\n this.args.onClick(event1);\n }\n }\n static{\n template(`\n <button\n type=\"button\"\n class={{this.classes.base}}\n ...attributes\n {{on \"click\" this.handleClick}}\n >\n\n {{#if (has-block)}}\n {{yield this.classes.icon}}\n {{else}}\n <svg\n class={{this.classes.icon}}\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M6 18L18 6M6 6l12 12\"\n ></path>\n </svg>\n {{/if}}\n\n <VisuallyHidden>\n {{if @title @title \"Close\"}}\n </VisuallyHidden>\n </button>\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n};\nexport { CloseButton, CloseButtonSignature };\nexport default CloseButton;\n"],"names":["CloseButton","_class","_class2","Component","classes","closeButton","closeButton1","useStyles","base","base1","icon","icon1","size","args","class","handleClick","event1","onClick","setComponentTemplate","precompileTemplate","scope","on","VisuallyHidden","strictMode","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;AA8BIA,IAAAA,WAAW,IAAAC,MAAA,IAAAC,OAAA,GAAG,MAAMF,WAAW,SAASG,SAAS,CAAuB;EACxE,IAAIC,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,WAAW,EAAEC,YAAAA;KAAc,GAAGC,SAAS,EAAE,CAAA;IACjD,IAAI;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,IAAI,EAAEC,KAAAA;KAAO,GAAGL,YAAY,CAAC;AAC5CM,MAAAA,IAAI,EAAE,IAAI,CAACC,IAAI,CAACD,IAAI,IAAI,IAAA;AAC5B,KAAC,CAAC,CAAA;IACF,OAAO;MACHJ,IAAI,EAAEC,KAAK,CAAC;AACRK,QAAAA,KAAK,EAAE,IAAI,CAACD,IAAI,CAACC,KAAAA;AACrB,OAAC,CAAC;MACFJ,IAAI,EAAEC,KAAK,EAAC;KACf,CAAA;AACL,GAAA;EAEAI,WAAWA,CAACC,MAAa,EAAQ;IAC7B,IAAI,OAAO,IAAI,CAACH,IAAI,CAACI,OAAO,KAAK,UAAU,EAAE;AACzC,MAAA,IAAI,CAACJ,IAAI,CAACI,OAAO,CAACD,MAAM,CAAC,CAAA;AAC7B,KAAA;AACJ,GAAA;AAyCJ,CAAC,EAAAE,oBAAA,CAvCOC,kBAAA,CAgCH,smBAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,EAAA;AAAAC,IAAAA,cAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAArB,OAAA,CAAAA,EAAAA,OAAA,CAAAsB,GAAAA,yBAAA,CAAAvB,MAAA,CAAAwB,SAAA,EA5CLC,aAAAA,EAAAA,CAAAA,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAA3B,MAAA,CAAAwB,SAAA,EAAAxB,aAAAA,CAAAA,EAAAA,MAAA,CAAAwB,SAAA,CAAAxB,GAAAA,MAAA;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { on } from '@ember/modifier';
|
|
4
|
+
import { useStyles } from '@frontile/theme';
|
|
5
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
|
+
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
|
|
8
|
+
var _class;
|
|
9
|
+
let ToggleButton = (_class = class ToggleButton extends Component {
|
|
10
|
+
constructor(...args) {
|
|
11
|
+
super(...args);
|
|
12
|
+
_defineProperty(this, "onChange", () => {
|
|
13
|
+
if (typeof this.args.onChange === 'function') {
|
|
14
|
+
this.args.onChange(!this.isSelected);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
get classNames() {
|
|
19
|
+
const {
|
|
20
|
+
toggleButton: toggleButton1
|
|
21
|
+
} = useStyles();
|
|
22
|
+
return toggleButton1({
|
|
23
|
+
intent: this.args.intent || 'default',
|
|
24
|
+
size: this.args.size,
|
|
25
|
+
appearance: 'outlined',
|
|
26
|
+
isSelected: this.isSelected,
|
|
27
|
+
isInGroup: this.args.isInGroup,
|
|
28
|
+
class: this.args.class
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
get isSelected() {
|
|
32
|
+
return !!this.args.isSelected;
|
|
33
|
+
}
|
|
34
|
+
}, setComponentTemplate(precompileTemplate("\n <button type=\"button\" {{on \"click\" this.onChange}} class={{this.classNames}} aria-pressed=\"{{this.isSelected}}\" ...attributes>\n {{yield}}\n </button>\n ", {
|
|
35
|
+
scope: () => ({
|
|
36
|
+
on
|
|
37
|
+
}),
|
|
38
|
+
strictMode: true
|
|
39
|
+
}), _class), _class);
|
|
40
|
+
|
|
41
|
+
export { ToggleButton, ToggleButton as default };
|
|
42
|
+
//# sourceMappingURL=toggle-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-button.js","sources":["../../src/components/toggle-button.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\nimport type { ButtonArgs } from './button';\ninterface ToggleButtonArgs extends Pick<ButtonArgs, 'intent' | 'size' | 'class' | 'isInGroup'> {\n /**\n * If the button is currently selected\n *\n * @defaultValue false\n */ isSelected?: boolean;\n /**\n * Callback when the buttle is toggled\n */ onChange?: (isSelected: boolean) => void;\n}\ninterface ToggleButtonSignature {\n Args: ToggleButtonArgs;\n Blocks: {\n default: [];\n };\n Element: HTMLButtonElement;\n}\nlet ToggleButton = class ToggleButton extends Component<ToggleButtonSignature> {\n get classNames(): string {\n const { toggleButton: toggleButton1 } = useStyles();\n return toggleButton1({\n intent: this.args.intent || 'default',\n size: this.args.size,\n appearance: 'outlined',\n isSelected: this.isSelected,\n isInGroup: this.args.isInGroup,\n class: this.args.class\n });\n }\n get isSelected() {\n return !!this.args.isSelected;\n }\n onChange = ()=>{\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(!this.isSelected);\n }\n };\n static{\n template(`\n <button\n type=\"button\"\n {{on \"click\" this.onChange}}\n class={{this.classNames}}\n aria-pressed=\"{{this.isSelected}}\"\n ...attributes\n >\n {{yield}}\n </button>\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n};\nexport { ToggleButton, ToggleButtonSignature };\nexport default ToggleButton;\n"],"names":["ToggleButton","_class","Component","constructor","args","_defineProperty","onChange","isSelected","classNames","toggleButton","toggleButton1","useStyles","intent","size","appearance","isInGroup","class","setComponentTemplate","precompileTemplate","scope","on","strictMode"],"mappings":";;;;;;;;AAsBIA,IAAAA,YAAY,IAAAC,MAAA,GAAG,MAAMD,YAAY,SAASE,SAAS,CAAwB;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,mBAehE,MAAI;MACX,IAAI,OAAO,IAAI,CAACD,IAAI,CAACE,QAAQ,KAAK,UAAU,EAAE;QAC1C,IAAI,CAACF,IAAI,CAACE,QAAQ,CAAC,CAAC,IAAI,CAACC,UAAU,CAAC,CAAA;AACxC,OAAA;KACH,CAAA,CAAA;AAAA,GAAA;EAlBD,IAAIC,UAAUA,GAAW;IACrB,MAAM;AAAEC,MAAAA,YAAY,EAAEC,aAAAA;KAAe,GAAGC,SAAS,EAAE,CAAA;AACnD,IAAA,OAAOD,aAAa,CAAC;AACjBE,MAAAA,MAAM,EAAE,IAAI,CAACR,IAAI,CAACQ,MAAM,IAAI,SAAS;AACrCC,MAAAA,IAAI,EAAE,IAAI,CAACT,IAAI,CAACS,IAAI;AACpBC,MAAAA,UAAU,EAAE,UAAU;MACtBP,UAAU,EAAE,IAAI,CAACA,UAAU;AAC3BQ,MAAAA,SAAS,EAAE,IAAI,CAACX,IAAI,CAACW,SAAS;AAC9BC,MAAAA,KAAK,EAAE,IAAI,CAACZ,IAAI,CAACY,KAAAA;AACrB,KAAC,CAAC,CAAA;AACN,GAAA;EACA,IAAIT,UAAUA,GAAG;AACb,IAAA,OAAO,CAAC,CAAC,IAAI,CAACH,IAAI,CAACG,UAAU,CAAA;AACjC,GAAA;AAwBJ,CAAC,EAAAU,oBAAA,CAjBOC,kBAAA,CAUH,gLAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA,EAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAApB,MAAA,CAAA,EAAAA,MAAA;;;;"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Button } from './components/button.js';
|
|
2
|
+
export { CloseButton } from './components/close-button.js';
|
|
3
|
+
export { ToggleButton } from './components/toggle-button.js';
|
|
4
|
+
export { ButtonGroup } from './components/button-group.js';
|
|
5
|
+
export { Chip } from './components/chip.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontile/buttons",
|
|
3
|
-
"version": "0.17.0-alpha.
|
|
3
|
+
"version": "0.17.0-alpha.5",
|
|
4
4
|
"description": "Component Library for Ember Octane apps: Buttons",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -40,32 +40,34 @@
|
|
|
40
40
|
"ember-source": "^4.0.0 || ^5.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"@ember/render-modifiers": "^2.1.0",
|
|
43
44
|
"@embroider/addon-shim": "^1.8.7",
|
|
44
|
-
"@frontile/
|
|
45
|
-
"@frontile/
|
|
45
|
+
"@frontile/theme": "0.17.0-alpha.5",
|
|
46
|
+
"@frontile/utilities": "0.17.0-alpha.5"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@babel/core": "7.23.
|
|
49
|
+
"@babel/core": "7.23.7",
|
|
49
50
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
50
|
-
"@babel/plugin-proposal-decorators": "7.23.
|
|
51
|
+
"@babel/plugin-proposal-decorators": "7.23.7",
|
|
51
52
|
"@babel/plugin-transform-class-static-block": "^7.23.4",
|
|
53
|
+
"@babel/plugin-transform-private-methods": "^7.23.3",
|
|
52
54
|
"@babel/preset-typescript": "7.23.3",
|
|
53
55
|
"@embroider/addon-dev": "4.1.3",
|
|
54
56
|
"@glimmer/component": "^1.1.2",
|
|
55
57
|
"@glimmer/tracking": "^1.1.2",
|
|
56
|
-
"@glint/core": "1.
|
|
57
|
-
"@glint/environment-ember-loose": "1.
|
|
58
|
-
"@glint/environment-ember-template-imports": "1.
|
|
59
|
-
"@glint/template": "1.
|
|
58
|
+
"@glint/core": "1.3.0",
|
|
59
|
+
"@glint/environment-ember-loose": "1.3.0",
|
|
60
|
+
"@glint/environment-ember-template-imports": "1.3.0",
|
|
61
|
+
"@glint/template": "1.3.0",
|
|
60
62
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
61
|
-
"@tsconfig/ember": "^3.0.
|
|
62
|
-
"babel-plugin-ember-template-compilation": "^2.
|
|
63
|
-
"concurrently": "^8.2.
|
|
63
|
+
"@tsconfig/ember": "^3.0.3",
|
|
64
|
+
"babel-plugin-ember-template-compilation": "^2.2.1",
|
|
65
|
+
"concurrently": "^8.2.2",
|
|
64
66
|
"ember-source": "^5.5.0",
|
|
65
|
-
"rollup": "^4.9.
|
|
66
|
-
"rollup-plugin-ts": "^3.
|
|
67
|
-
"tailwindcss": "^3.
|
|
68
|
-
"typescript": "^5.
|
|
67
|
+
"rollup": "^4.9.6",
|
|
68
|
+
"rollup-plugin-ts": "^3.4.5",
|
|
69
|
+
"tailwindcss": "^3.4.1",
|
|
70
|
+
"typescript": "^5.3.3"
|
|
69
71
|
},
|
|
70
72
|
"engines": {
|
|
71
73
|
"node": "10.* || >= 12"
|
|
@@ -81,8 +83,11 @@
|
|
|
81
83
|
"type": "addon",
|
|
82
84
|
"main": "addon-main.js",
|
|
83
85
|
"app-js": {
|
|
86
|
+
"./components/button-group.js": "./dist/_app_/components/button-group.js",
|
|
84
87
|
"./components/button.js": "./dist/_app_/components/button.js",
|
|
85
|
-
"./components/chip.js": "./dist/_app_/components/chip.js"
|
|
88
|
+
"./components/chip.js": "./dist/_app_/components/chip.js",
|
|
89
|
+
"./components/close-button.js": "./dist/_app_/components/close-button.js",
|
|
90
|
+
"./components/toggle-button.js": "./dist/_app_/components/toggle-button.js"
|
|
86
91
|
}
|
|
87
92
|
},
|
|
88
93
|
"exports": {
|
|
@@ -103,5 +108,5 @@
|
|
|
103
108
|
]
|
|
104
109
|
}
|
|
105
110
|
},
|
|
106
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "7e01670d8d6f8f3f807ab292f5a64694bcbc1fc7"
|
|
107
112
|
}
|