@frontile/buttons 0.18.0-alpha.4 → 0.18.0-alpha.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.
@@ -1,5 +1 @@
1
- export * from './components/button';
2
- export * from './components/close-button';
3
- export * from './components/toggle-button';
4
- export * from './components/button-group';
5
- export * from './components/chip';
1
+ export * from 'frontile/buttons';
@@ -1,8 +1 @@
1
- import type { Button, ButtonGroup, Chip, CloseButton, ToggleButton } from './index';
2
- export default interface Registry {
3
- Button: typeof Button;
4
- Chip: typeof Chip;
5
- ToggleButton: typeof ToggleButton;
6
- ButtonGroup: typeof ButtonGroup;
7
- CloseButton: typeof CloseButton;
8
- }
1
+ export type { default } from 'frontile/template-registry';
package/dist/index.js CHANGED
@@ -1,6 +1,14 @@
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';
1
+ import { deprecate } from '@ember/debug';
2
+ export * from 'frontile/buttons';
3
+
4
+ deprecate('Importing from "@frontile/buttons" is deprecated. ' + 'Import from "frontile" or "frontile/buttons" instead. ' + 'See https://frontile.dev/docs/migrations/v0.18/package-consolidation', false, {
5
+ id: 'frontile.import-from-buttons',
6
+ until: '0.19.0',
7
+ for: 'frontile',
8
+ since: {
9
+ available: '0.18.0',
10
+ enabled: '0.18.0'
11
+ },
12
+ url: 'https://frontile.dev/docs/migrations/v0.18/package-consolidation'
13
+ });
6
14
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\ndeprecate(\n 'Importing from \"@frontile/buttons\" is deprecated. ' +\n 'Import from \"frontile\" or \"frontile/buttons\" instead. ' +\n 'See https://frontile.dev/docs/migrations/v0.18/package-consolidation',\n false,\n {\n id: 'frontile.import-from-buttons',\n until: '0.19.0',\n for: 'frontile',\n since: { available: '0.18.0', enabled: '0.18.0' },\n url: 'https://frontile.dev/docs/migrations/v0.18/package-consolidation'\n }\n);\n\nexport * from 'frontile/buttons';\n"],"names":["deprecate","id","until","for","since","available","enabled","url"],"mappings":";;;AAEAA,SAAS,CACP,oDAAoD,GAClD,wDAAwD,GACxD,sEAAsE,EACxE,KAAK,EACL;AACEC,EAAAA,EAAE,EAAE,8BAA8B;AAClCC,EAAAA,KAAK,EAAE,QAAQ;AACfC,EAAAA,GAAG,EAAE,UAAU;AACfC,EAAAA,KAAK,EAAE;AAAEC,IAAAA,SAAS,EAAE,QAAQ;AAAEC,IAAAA,OAAO,EAAE;GAAU;AACjDC,EAAAA,GAAG,EAAE;AACP,CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/buttons",
3
- "version": "0.18.0-alpha.4",
3
+ "version": "0.18.0-alpha.6",
4
4
  "description": "Component Library for Ember Octane apps: Buttons",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -36,25 +36,9 @@
36
36
  "declarations",
37
37
  "dist"
38
38
  ],
39
- "scripts": {
40
- "build": "rollup --config",
41
- "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
42
- "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
43
- "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
44
- "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
45
- "lint:js": "eslint . --cache",
46
- "lint:js:fix": "eslint . --fix",
47
- "lint:types": "glint",
48
- "prepack": "concurrently 'npm:build'",
49
- "start": "concurrently 'npm:start:*'",
50
- "start:js": "rollup --config --watch --no-watch.clearScreen",
51
- "start:types": "glint -d --watch",
52
- "test": "echo 'A v2 addon does not have tests, run tests in test-app'"
53
- },
54
39
  "dependencies": {
55
40
  "@embroider/addon-shim": "^1.9.0",
56
- "@frontile/theme": "0.18.0-alpha.4",
57
- "@frontile/utilities": "0.18.0-alpha.4"
41
+ "frontile": "0.18.0-alpha.6"
58
42
  },
59
43
  "devDependencies": {
60
44
  "@babel/core": "7.26.7",
@@ -96,13 +80,21 @@
96
80
  "version": 2,
97
81
  "type": "addon",
98
82
  "main": "addon-main.js",
99
- "app-js": {
100
- "./components/button-group.js": "./dist/_app_/components/button-group.js",
101
- "./components/button.js": "./dist/_app_/components/button.js",
102
- "./components/chip.js": "./dist/_app_/components/chip.js",
103
- "./components/close-button.js": "./dist/_app_/components/close-button.js",
104
- "./components/toggle-button.js": "./dist/_app_/components/toggle-button.js"
105
- }
83
+ "app-js": {}
106
84
  },
107
- "gitHead": "47b672eada26e796a5aff533779f14ca5fcbfa99"
108
- }
85
+ "gitHead": "b8b177161d94077c43a7179e1c3fa77530a266fb",
86
+ "scripts": {
87
+ "build": "rollup --config",
88
+ "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
89
+ "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
90
+ "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
91
+ "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
92
+ "lint:js": "eslint . --cache",
93
+ "lint:js:fix": "eslint . --fix",
94
+ "lint:types": "glint",
95
+ "start": "concurrently 'npm:start:*'",
96
+ "start:js": "rollup --config --watch --no-watch.clearScreen",
97
+ "start:types": "glint -d --watch",
98
+ "test": "echo 'A v2 addon does not have tests, run tests in test-app'"
99
+ }
100
+ }
@@ -1 +0,0 @@
1
- export { default } from "@frontile/buttons/components/button-group";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/buttons/components/button";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/buttons/components/chip";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/buttons/components/close-button";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/buttons/components/toggle-button";
@@ -1,31 +0,0 @@
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
- class ButtonGroup extends Component {
10
- get classNames() {
11
- const {
12
- buttonGroup
13
- } = useStyles();
14
- return buttonGroup({
15
- class: this.args.class
16
- });
17
- }
18
- static {
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
- strictMode: true,
21
- scope: () => ({
22
- hash,
23
- Button,
24
- ToggleButton
25
- })
26
- }), this);
27
- }
28
- }
29
-
30
- export { ButtonGroup, ButtonGroup as default };
31
- //# sourceMappingURL=button-group.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"button-group.js","sources":["../../src/components/button-group.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport Button, { type ButtonSignature } from './button';\nimport type { ButtonArgs } from './button';\nimport ToggleButton, { type ToggleButtonSignature } from './toggle-button';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\n\ninterface ButtonGroupArgs\n extends Pick<ButtonArgs, 'appearance' | 'intent' | 'size' | 'class'> {}\n\ninterface ButtonGroupSignature {\n Args: ButtonGroupArgs;\n Blocks: {\n default: [\n {\n Button: WithBoundArgs<ComponentLike<ButtonSignature>, 'isInGroup'>;\n ToggleButton: WithBoundArgs<\n ComponentLike<ToggleButtonSignature>,\n 'isInGroup'\n >;\n }\n ];\n };\n Element: HTMLDivElement;\n}\n\nclass ButtonGroup extends Component<ButtonGroupSignature> {\n get classNames(): string {\n const { buttonGroup } = useStyles();\n\n return buttonGroup({\n class: this.args.class\n });\n }\n\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 </template>\n}\n\nexport { ButtonGroup, type ButtonGroupSignature };\nexport default ButtonGroup;\n"],"names":["ButtonGroup","Component","classNames","buttonGroup","useStyles","class","args","setComponentTemplate","precompileTemplate","strictMode","scope","hash","Button","ToggleButton"],"mappings":";;;;;;;;AA2BA,MAAMA,oBAAoBC,SAAA,CAAU;EAClC,IAAIC,UAAAA,GAAqB;IACvB,MAAM;AAAEC,MAAAA;KAAa,GAAGC,SAAA,EAAA;AAExB,IAAA,OAAOD,WAAA,CAAY;AACjBE,MAAAA,KAAA,EAAO,IAAI,CAACC,IAAI,CAACD;AACnB,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAE,oBAAA,CAAAC,kBAAA,CAAA,qRAAA,EAiBA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;QAAAC,MAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -1,55 +0,0 @@
1
- import Component from '@glimmer/component';
2
- import { hash } from '@ember/helper';
3
- import { tracked } from '@glimmer/tracking';
4
- import { useStyles } from '@frontile/theme';
5
- import { press } from '@frontile/utilities';
6
- import { precompileTemplate } from '@ember/template-compilation';
7
- import { setComponentTemplate } from '@ember/component';
8
- import { d as decorateFieldV2, i as initializeDeferredDecorator } from '../runtime-BPCpkOf1-B5Lbloj7.js';
9
-
10
- class Button extends Component {
11
- static {
12
- decorateFieldV2(this.prototype, "isPressed", [tracked], function () {
13
- return false;
14
- });
15
- }
16
- #isPressed = (initializeDeferredDecorator(this, "isPressed"), void 0);
17
- get type() {
18
- if (this.args.type) {
19
- return this.args.type;
20
- }
21
- return 'button';
22
- }
23
- get classNames() {
24
- const {
25
- button
26
- } = useStyles();
27
- return button({
28
- intent: this.args.intent || 'default',
29
- size: this.args.size,
30
- appearance: this.args.appearance || 'default',
31
- isInGroup: this.args.isInGroup,
32
- class: this.args.class
33
- });
34
- }
35
- handlePressChange = isPressed => {
36
- this.isPressed = isPressed;
37
- };
38
- onPress = event => {
39
- if (typeof this.args.onPress === 'function') {
40
- this.args.onPress(event);
41
- }
42
- };
43
- static {
44
- setComponentTemplate(precompileTemplate("\n {{#if @isRenderless}}\n {{yield (hash classNames=this.classNames)}}\n {{else}}\n <button type={{this.type}} class={{this.classNames}} data-pressed={{if this.isPressed \"true\"}} {{press this.onPress onPressChange=this.handlePressChange}} ...attributes>\n {{yield (hash classNames=this.classNames)}}\n </button>\n {{/if}}\n ", {
45
- strictMode: true,
46
- scope: () => ({
47
- hash,
48
- press
49
- })
50
- }), this);
51
- }
52
- }
53
-
54
- export { Button, Button as default };
55
- //# sourceMappingURL=button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"button.js","sources":["../../src/components/button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { tracked } from '@glimmer/tracking';\nimport { useStyles } from '@frontile/theme';\nimport { press, type PressEvent } from '@frontile/utilities';\n\nexport interface ButtonArgs {\n /**\n * The HTML type of the button\n *\n * @defaultValue 'button'\n */\n type?: 'button' | 'submit' | 'reset';\n\n /**\n * The button appearance\n *\n * @defaultValue 'default'\n */\n appearance?: 'default' | 'outlined' | 'minimal' | 'tonal' | 'custom';\n\n /**\n * The intent of the button\n */\n intent?: 'default' | 'primary' | 'accent' | 'success' | 'warning' | 'danger';\n\n /**\n * The size of the button\n */\n size?: 'xs' | 'sm' | 'lg' | 'xl';\n\n /**\n * Disable rendering the button element. It yields an object with classNames instead.\n */\n isRenderless?: boolean;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n\n /**\n * If button is part of a group. Most of the time, this is automatically set\n * when using the ButtonGroup component.\n */\n isInGroup?: boolean;\n\n /**\n * Callback for when the button is pressed.\n */\n onPress?: (event: PressEvent) => void;\n}\n\ninterface ButtonSignature {\n Args: ButtonArgs;\n Blocks: {\n default: [{ classNames: string }];\n };\n Element: HTMLButtonElement;\n}\n\nclass Button extends Component<ButtonSignature> {\n @tracked isPressed = false;\n\n get type(): string {\n if (this.args.type) {\n return this.args.type;\n }\n return 'button';\n }\n\n get classNames(): string {\n const { button } = useStyles();\n\n return button({\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\n handlePressChange = (isPressed: boolean): void => {\n this.isPressed = isPressed;\n };\n\n onPress = (event: PressEvent) => {\n if (typeof this.args.onPress === 'function') {\n this.args.onPress(event);\n }\n };\n\n <template>\n {{#if @isRenderless}}\n {{yield (hash classNames=this.classNames)}}\n {{else}}\n <button\n type={{this.type}}\n class={{this.classNames}}\n data-pressed={{if this.isPressed \"true\"}}\n {{press this.onPress onPressChange=this.handlePressChange}}\n ...attributes\n >\n {{yield (hash classNames=this.classNames)}}\n </button>\n {{/if}}\n </template>\n}\n\nexport { Button, type ButtonSignature };\nexport default Button;\n"],"names":["Button","Component","g","prototype","tracked","i","void 0","type","args","classNames","button","useStyles","intent","size","appearance","isInGroup","class","handlePressChange","isPressed","onPress","event","setComponentTemplate","precompileTemplate","strictMode","scope","hash","press"],"mappings":";;;;;;;;;AA6DA,MAAMA,eAAeC,SAAA,CAAU;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CAC5BC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAAC,MAAA;EAErB,IAAIC,IAAAA,GAAe;AACjB,IAAA,IAAI,IAAI,CAACC,IAAI,CAACD,IAAI,EAAE;AAClB,MAAA,OAAO,IAAI,CAACC,IAAI,CAACD,IAAI;AACvB,IAAA;AACA,IAAA,OAAO,QAAA;AACT,EAAA;EAEA,IAAIE,UAAAA,GAAqB;IACvB,MAAM;AAAEC,MAAAA;KAAQ,GAAGC,SAAA,EAAA;AAEnB,IAAA,OAAOD,MAAA,CAAO;AACZE,MAAAA,MAAA,EAAQ,IAAI,CAACJ,IAAI,CAACI,MAAM,IAAI,SAAA;AAC5BC,MAAAA,IAAA,EAAM,IAAI,CAACL,IAAI,CAACK,IAAI;AACpBC,MAAAA,UAAA,EAAY,IAAI,CAACN,IAAI,CAACM,UAAU,IAAI,SAAA;AACpCC,MAAAA,SAAA,EAAW,IAAI,CAACP,IAAI,CAACO,SAAS;AAC9BC,MAAAA,KAAA,EAAO,IAAI,CAACR,IAAI,CAACQ;AACnB,KAAA,CAAA;AACF,EAAA;EAEAC,iBAAA,GAAqBC,SAAkB,IAAO;IAC5C,IAAI,CAACA,SAAS,GAAGA,SAAA;EACnB,CAAA;EAEAC,OAAA,GAAWC,KAAO,IAAA;IAChB,IAAI,OAAO,IAAI,CAACZ,IAAI,CAACW,OAAO,KAAK,UAAA,EAAY;AAC3C,MAAA,IAAI,CAACX,IAAI,CAACW,OAAO,CAACC,KAAA,CAAA;AACpB,IAAA;EACF,CAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,wWAAA,EAcA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -1,44 +0,0 @@
1
- import Component from '@glimmer/component';
2
- import { useStyles } from '@frontile/theme';
3
- import { CloseButton } from './close-button.js';
4
- import { precompileTemplate } from '@ember/template-compilation';
5
- import { setComponentTemplate } from '@ember/component';
6
-
7
- class Chip extends Component {
8
- get classNames() {
9
- const {
10
- chip
11
- } = useStyles();
12
- const {
13
- base,
14
- content,
15
- dot,
16
- closeButton
17
- } = chip({
18
- intent: this.args.intent || 'default',
19
- size: this.args.size,
20
- appearance: this.args.appearance || 'default',
21
- radius: this.args.radius,
22
- isDisabled: this.args.isDisabled
23
- });
24
- return {
25
- base: base({
26
- class: this.args.class
27
- }),
28
- content: content(),
29
- dot: dot(),
30
- closeButton: closeButton()
31
- };
32
- }
33
- static {
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 ", {
35
- strictMode: true,
36
- scope: () => ({
37
- CloseButton
38
- })
39
- }), this);
40
- }
41
- }
42
-
43
- export { Chip, Chip as default };
44
- //# sourceMappingURL=chip.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chip.js","sources":["../../src/components/chip.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { CloseButton } from './close-button';\n\ninterface ChipSignature {\n Args: {\n /**\n * The chip appearance\n *\n * @defaultValue 'default'\n */\n appearance?: 'default' | 'outlined' | 'faded';\n\n /**\n * The intent of the chip\n */\n intent?:\n | 'default'\n | 'primary'\n | 'accent'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * The size of the chip\n */\n size?: 'sm' | 'md' | 'lg';\n\n /**\n * The radius the chip\n */\n radius?: 'none' | 'sm' | 'lg' | 'full';\n\n /**\n * Option to add dot to the chip\n */\n withDot?: boolean;\n\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 */\n onClose?: () => void;\n\n /**\n * Disables the clip and disables the close button if any.\n */\n isDisabled?: boolean;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\n\nclass Chip extends Component<ChipSignature> {\n get classNames() {\n const { chip } = useStyles();\n\n const { base, content, dot, closeButton } = chip({\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\n return {\n base: base({ class: this.args.class }),\n content: content(),\n dot: dot(),\n closeButton: closeButton()\n };\n }\n\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 </template>\n}\n\nexport { Chip, type ChipSignature };\nexport default Chip;\n"],"names":["Chip","Component","classNames","chip","useStyles","base","content","dot","closeButton","intent","args","size","appearance","radius","isDisabled","class","setComponentTemplate","precompileTemplate","strictMode","scope","CloseButton"],"mappings":";;;;;;AA6DA,MAAMA,aAAaC,SAAA,CAAU;EAC3B,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAM,GAAGC,SAAA,EAAA;IAEjB,MAAM;MAAEC,IAAI;MAAEC,OAAO;MAAEC,GAAG;AAAEC,MAAAA;KAAa,GAAGL,IAAA,CAAK;AAC/CM,MAAAA,MAAA,EAAQ,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,SAAA;AAC5BE,MAAAA,IAAA,EAAM,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,UAAA,EAAY,IAAI,CAACF,IAAI,CAACE,UAAU,IAAI,SAAA;AACpCC,MAAAA,MAAA,EAAQ,IAAI,CAACH,IAAI,CAACG,MAAM;AACxBC,MAAAA,UAAA,EAAY,IAAI,CAACJ,IAAI,CAACI;AACxB,KAAA,CAAA;IAEA,OAAO;MACLT,IAAA,EAAMA,IAAA,CAAK;AAAEU,QAAAA,KAAA,EAAO,IAAI,CAACL,IAAI,CAACK;AAAM,OAAA,CAAA;MACpCT,OAAA,EAASA,OAAA,EAAA;MACTC,GAAA,EAAKA,GAAA,EAAA;MACLC,WAAA,EAAaA,WAAA;KACf;AACF,EAAA;AAEA,EAAA;IAAAQ,oBAAA,CAAAC,kBAAA,CAAA,8YAAA,EAgBA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -1,83 +0,0 @@
1
- import Component from '@glimmer/component';
2
- import { action } from '@ember/object';
3
- import { tracked } from '@glimmer/tracking';
4
- import { on } from '@ember/modifier';
5
- import { deprecate } from '@ember/debug';
6
- import { VisuallyHidden, press } from '@frontile/utilities';
7
- import { useStyles } from '@frontile/theme';
8
- import { precompileTemplate } from '@ember/template-compilation';
9
- import { setComponentTemplate } from '@ember/component';
10
- import { d as decorateFieldV2, i as initializeDeferredDecorator, a as decorateMethodV2 } from '../runtime-BPCpkOf1-B5Lbloj7.js';
11
-
12
- class CloseButton extends Component {
13
- static {
14
- decorateFieldV2(this.prototype, "isPressed", [tracked], function () {
15
- return false;
16
- });
17
- }
18
- #isPressed = (initializeDeferredDecorator(this, "isPressed"), void 0);
19
- constructor(owner, args) {
20
- super(owner, args);
21
- if (args.onClick) {
22
- deprecate('CloseButton: onClick is deprecated. Use onPress instead for better cross-platform support including touch, keyboard, and screen reader interactions.', false, {
23
- id: 'frontile.close-button.onClick',
24
- until: '0.18.0',
25
- for: '@frontile/buttons',
26
- since: {
27
- available: '0.17.0',
28
- enabled: '0.17.0'
29
- }
30
- });
31
- }
32
- }
33
- get classes() {
34
- const {
35
- closeButton
36
- } = useStyles();
37
- let {
38
- base,
39
- icon
40
- } = closeButton({
41
- size: this.args.size || 'md',
42
- variant: this.args.variant || 'transparent'
43
- });
44
- return {
45
- base: base({
46
- class: this.args.class
47
- }),
48
- icon: icon()
49
- };
50
- }
51
- handlePressChange = isPressed => {
52
- this.isPressed = isPressed;
53
- };
54
- handlePress(event) {
55
- if (typeof this.args.onPress === 'function') {
56
- this.args.onPress(event);
57
- }
58
- }
59
- static {
60
- decorateMethodV2(this.prototype, "handlePress", [action]);
61
- }
62
- handleClick(event) {
63
- if (typeof this.args.onClick === 'function') {
64
- this.args.onClick(event);
65
- }
66
- }
67
- static {
68
- decorateMethodV2(this.prototype, "handleClick", [action]);
69
- }
70
- static {
71
- setComponentTemplate(precompileTemplate("\n <button type=\"button\" class={{this.classes.base}} data-pressed={{if this.isPressed \"true\"}} ...attributes {{press this.handlePress onPressChange=this.handlePressChange}} {{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 ", {
72
- strictMode: true,
73
- scope: () => ({
74
- press,
75
- on,
76
- VisuallyHidden
77
- })
78
- }), this);
79
- }
80
- }
81
-
82
- export { CloseButton, CloseButton as default };
83
- //# sourceMappingURL=close-button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"close-button.js","sources":["../../src/components/close-button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\nimport { deprecate } from '@ember/debug';\nimport { VisuallyHidden, press, type PressEvent } from '@frontile/utilities';\nimport { useStyles, type CloseButtonVariants } from '@frontile/theme';\nimport type Owner from '@ember/owner';\n\ninterface CloseButtonSignature {\n Args: {\n /**\n * The title of the close button\n *\n * @defaultValue 'Close'\n */\n title?: string;\n\n /**\n * The icon size\n *\n * @defaultValue 'lg'\n */\n size?: CloseButtonVariants['size'];\n\n /**\n * @defaultValue 'transparent'\n */\n variant?: CloseButtonVariants['variant'];\n\n /**\n * The function to call when button is pressed\n */\n onPress?: (event: PressEvent) => void;\n\n /**\n * Deprecated: The function to call when button is clicked\n *\n * @deprecated Use onPress instead for better cross-platform support\n */\n onClick?: (event: Event) => void;\n\n /**\n * Additional class for close button element\n */\n class?: string;\n };\n Blocks: {\n default: [string | null];\n };\n Element: HTMLButtonElement;\n}\n\nclass CloseButton extends Component<CloseButtonSignature> {\n @tracked isPressed = false;\n\n constructor(owner: Owner, args: CloseButtonSignature['Args']) {\n super(owner, args);\n\n if (args.onClick) {\n deprecate(\n 'CloseButton: onClick is deprecated. Use onPress instead for better cross-platform support including touch, keyboard, and screen reader interactions.',\n false,\n {\n id: 'frontile.close-button.onClick',\n until: '0.18.0',\n for: '@frontile/buttons',\n since: { available: '0.17.0', enabled: '0.17.0' }\n }\n );\n }\n }\n\n get classes() {\n const { closeButton } = useStyles();\n\n let { base, icon } = closeButton({\n size: this.args.size || 'md',\n variant: this.args.variant || 'transparent'\n });\n\n return {\n base: base({ class: this.args.class }),\n icon: icon()\n };\n }\n\n handlePressChange = (isPressed: boolean): void => {\n this.isPressed = isPressed;\n };\n\n @action handlePress(event: PressEvent): void {\n if (typeof this.args.onPress === 'function') {\n this.args.onPress(event);\n }\n }\n\n @action handleClick(event: Event): void {\n if (typeof this.args.onClick === 'function') {\n this.args.onClick(event);\n }\n }\n\n <template>\n <button\n type=\"button\"\n class={{this.classes.base}}\n data-pressed={{if this.isPressed \"true\"}}\n ...attributes\n {{press this.handlePress onPressChange=this.handlePressChange}}\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 </template>\n}\n\nexport { CloseButton, type CloseButtonSignature };\nexport default CloseButton;\n"],"names":["CloseButton","Component","g","prototype","tracked","i","void 0","constructor","owner","args","onClick","deprecate","id","until","for","since","available","enabled","classes","closeButton","useStyles","base","icon","size","variant","class","handlePressChange","isPressed","handlePress","event","onPress","n","action","handleClick","setComponentTemplate","precompileTemplate","strictMode","scope","press","on","VisuallyHidden"],"mappings":";;;;;;;;;;;AAqDA,MAAMA,oBAAoBC,SAAA,CAAU;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACjCC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAAC,MAAA;AAErBC,EAAAA,WAAAA,CAAYC,KAAY,EAAEC,IAAkC,EAAE;AAC5D,IAAA,KAAK,CAACD,KAAA,EAAOC,IAAA,CAAA;IAEb,IAAIA,IAAA,CAAKC,OAAO,EAAE;AAChBC,MAAAA,SAAA,CACE,wJACA,KAAA,EACA;AACEC,QAAAA,EAAA,EAAI,+BAAA;AACJC,QAAAA,KAAA,EAAO,QAAA;AACPC,QAAAA,GAAA,EAAK,mBAAA;AACLC,QAAAA,KAAA,EAAO;AAAEC,UAAAA,SAAA,EAAW,QAAA;AAAUC,UAAAA,OAAA,EAAS;AAAS;AAClD,OAAA,CAAA;AAEJ,IAAA;AACF,EAAA;EAEA,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAa,GAAGC,SAAA,EAAA;IAExB,IAAI;MAAEC,IAAI;AAAEC,MAAAA;KAAM,GAAGH,WAAA,CAAY;AAC/BI,MAAAA,IAAA,EAAM,IAAI,CAACd,IAAI,CAACc,IAAI,IAAI,IAAA;AACxBC,MAAAA,OAAA,EAAS,IAAI,CAACf,IAAI,CAACe,OAAO,IAAI;AAChC,KAAA,CAAA;IAEA,OAAO;MACLH,IAAA,EAAMA,IAAA,CAAK;AAAEI,QAAAA,KAAA,EAAO,IAAI,CAAChB,IAAI,CAACgB;AAAM,OAAA,CAAA;MACpCH,IAAA,EAAMA,IAAA;KACR;AACF,EAAA;EAEAI,iBAAA,GAAqBC,SAAkB,IAAO;IAC5C,IAAI,CAACA,SAAS,GAAGA,SAAA;EACnB,CAAA;EAEQC,WAAAA,CAAYC,KAAiB,EAAQ;IAC3C,IAAI,OAAO,IAAI,CAACpB,IAAI,CAACqB,OAAO,KAAK,UAAA,EAAY;AAC3C,MAAA,IAAI,CAACrB,IAAI,CAACqB,OAAO,CAACD,KAAA,CAAA;AACpB,IAAA;AACF,EAAA;AAAA,EAAA;IAAAE,gBAAA,CAAA,IAAA,CAAA5B,SAAA,EAAA,aAAA,EAAA,CAJC6B,MAAA,CAAA,CAAA;AAAA;EAMOC,WAAAA,CAAYJ,KAAY,EAAQ;IACtC,IAAI,OAAO,IAAI,CAACpB,IAAI,CAACC,OAAO,KAAK,UAAA,EAAY;AAC3C,MAAA,IAAI,CAACD,IAAI,CAACC,OAAO,CAACmB,KAAA,CAAA;AACpB,IAAA;AACF,EAAA;AAAA,EAAA;IAAAE,gBAAA,CAAA,IAAA,CAAA5B,SAAA,EAAA,aAAA,EAAA,CAJC6B,MAAA,CAAA,CAAA;AAAA;AAMD,EAAA;IAAAE,oBAAA,CAAAC,kBAAA,CAAA,ktBAAA,EAkCA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,KAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -1,40 +0,0 @@
1
- import Component from '@glimmer/component';
2
- import { useStyles } from '@frontile/theme';
3
- import { press } from '@frontile/utilities';
4
- import { precompileTemplate } from '@ember/template-compilation';
5
- import { setComponentTemplate } from '@ember/component';
6
-
7
- class ToggleButton extends Component {
8
- get classNames() {
9
- const {
10
- toggleButton
11
- } = useStyles();
12
- return toggleButton({
13
- intent: this.args.intent || 'default',
14
- size: this.args.size,
15
- appearance: 'outlined',
16
- isSelected: this.isSelected,
17
- isInGroup: this.args.isInGroup,
18
- class: this.args.class
19
- });
20
- }
21
- get isSelected() {
22
- return !!this.args.isSelected;
23
- }
24
- onChange = () => {
25
- if (typeof this.args.onChange === 'function') {
26
- this.args.onChange(!this.isSelected);
27
- }
28
- };
29
- static {
30
- setComponentTemplate(precompileTemplate("\n <button type=\"button\" {{press this.onChange}} class={{this.classNames}} aria-pressed=\"{{this.isSelected}}\" ...attributes>\n {{yield}}\n </button>\n ", {
31
- strictMode: true,
32
- scope: () => ({
33
- press
34
- })
35
- }), this);
36
- }
37
- }
38
-
39
- export { ToggleButton, ToggleButton as default };
40
- //# sourceMappingURL=toggle-button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toggle-button.js","sources":["../../src/components/toggle-button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport { press } from '@frontile/utilities';\nimport type { ButtonArgs } from './button';\n\ninterface ToggleButtonArgs\n extends Pick<ButtonArgs, 'intent' | 'size' | 'class' | 'isInGroup'> {\n /**\n * If the button is currently selected\n *\n * @defaultValue false\n */\n isSelected?: boolean;\n\n /**\n * Callback when the buttle is toggled\n */\n onChange?: (isSelected: boolean) => void;\n}\n\ninterface ToggleButtonSignature {\n Args: ToggleButtonArgs;\n Blocks: {\n default: [];\n };\n Element: HTMLButtonElement;\n}\n\nclass ToggleButton extends Component<ToggleButtonSignature> {\n get classNames(): string {\n const { toggleButton } = useStyles();\n\n return toggleButton({\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\n get isSelected() {\n return !!this.args.isSelected;\n }\n\n onChange = () => {\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(!this.isSelected);\n }\n };\n\n <template>\n <button\n type=\"button\"\n {{press this.onChange}}\n class={{this.classNames}}\n aria-pressed=\"{{this.isSelected}}\"\n ...attributes\n >\n {{yield}}\n </button>\n </template>\n}\n\nexport { ToggleButton, type ToggleButtonSignature };\nexport default ToggleButton;\n"],"names":["ToggleButton","Component","classNames","toggleButton","useStyles","intent","args","size","appearance","isSelected","isInGroup","class","onChange","setComponentTemplate","precompileTemplate","strictMode","scope","press"],"mappings":";;;;;;AA4BA,MAAMA,qBAAqBC,SAAA,CAAU;EACnC,IAAIC,UAAAA,GAAqB;IACvB,MAAM;AAAEC,MAAAA;KAAc,GAAGC,SAAA,EAAA;AAEzB,IAAA,OAAOD,YAAA,CAAa;AAClBE,MAAAA,MAAA,EAAQ,IAAI,CAACC,IAAI,CAACD,MAAM,IAAI,SAAA;AAC5BE,MAAAA,IAAA,EAAM,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,UAAA,EAAY,UAAA;MACZC,UAAA,EAAY,IAAI,CAACA,UAAU;AAC3BC,MAAAA,SAAA,EAAW,IAAI,CAACJ,IAAI,CAACI,SAAS;AAC9BC,MAAAA,KAAA,EAAO,IAAI,CAACL,IAAI,CAACK;AACnB,KAAA,CAAA;AACF,EAAA;EAEA,IAAIF,UAAAA,GAAa;AACf,IAAA,OAAO,CAAC,CAAC,IAAI,CAACH,IAAI,CAACG,UAAU;AAC/B,EAAA;EAEAG,QAAA,GAAWA,MAAA;IACT,IAAI,OAAO,IAAI,CAACN,IAAI,CAACM,QAAQ,KAAK,UAAA,EAAY;MAC5C,IAAI,CAACN,IAAI,CAACM,QAAQ,CAAC,CAAC,IAAI,CAACH,UAAU,CAAA;AACrC,IAAA;EACF,CAAA;AAEA,EAAA;IAAAI,oBAAA,CAAAC,kBAAA,CAAA,yKAAA,EAUA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}