@frontile/buttons 0.17.0-beta.18 → 0.17.0-beta.19

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,4 +1,5 @@
1
1
  import Component from '@glimmer/component';
2
+ import { type PressEvent } from '@frontile/utilities';
2
3
  export interface ButtonArgs {
3
4
  /**
4
5
  * The HTML type of the button
@@ -33,6 +34,10 @@ export interface ButtonArgs {
33
34
  * when using the ButtonGroup component.
34
35
  */
35
36
  isInGroup?: boolean;
37
+ /**
38
+ * Callback for when the button is pressed.
39
+ */
40
+ onPress?: (event: PressEvent) => void;
36
41
  }
37
42
  interface ButtonSignature {
38
43
  Args: ButtonArgs;
@@ -44,8 +49,11 @@ interface ButtonSignature {
44
49
  Element: HTMLButtonElement;
45
50
  }
46
51
  declare class Button extends Component<ButtonSignature> {
52
+ isPressed: boolean;
47
53
  get type(): string;
48
54
  get classNames(): string;
55
+ handlePressChange: (isPressed: boolean) => void;
56
+ onPress: (event: PressEvent) => void;
49
57
  }
50
58
  export { Button, type ButtonSignature };
51
59
  export default Button;
@@ -1,5 +1,7 @@
1
1
  import Component from '@glimmer/component';
2
+ import { type PressEvent } from '@frontile/utilities';
2
3
  import { type CloseButtonVariants } from '@frontile/theme';
4
+ import type Owner from '@ember/owner';
3
5
  interface CloseButtonSignature {
4
6
  Args: {
5
7
  /**
@@ -19,7 +21,13 @@ interface CloseButtonSignature {
19
21
  */
20
22
  variant?: CloseButtonVariants['variant'];
21
23
  /**
22
- * The function to call when button is clicked
24
+ * The function to call when button is pressed
25
+ */
26
+ onPress?: (event: PressEvent) => void;
27
+ /**
28
+ * Deprecated: The function to call when button is clicked
29
+ *
30
+ * @deprecated Use onPress instead for better cross-platform support
23
31
  */
24
32
  onClick?: (event: Event) => void;
25
33
  /**
@@ -33,10 +41,14 @@ interface CloseButtonSignature {
33
41
  Element: HTMLButtonElement;
34
42
  }
35
43
  declare class CloseButton extends Component<CloseButtonSignature> {
44
+ isPressed: boolean;
45
+ constructor(owner: Owner, args: CloseButtonSignature['Args']);
36
46
  get classes(): {
37
47
  base: string;
38
48
  icon: string;
39
49
  };
50
+ handlePressChange: (isPressed: boolean) => void;
51
+ handlePress(event: PressEvent): void;
40
52
  handleClick(event: Event): void;
41
53
  }
42
54
  export { CloseButton, type CloseButtonSignature };
@@ -1,10 +1,19 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { hash } from '@ember/helper';
3
+ import { tracked } from '@glimmer/tracking';
3
4
  import { useStyles } from '@frontile/theme';
5
+ import { press } from '@frontile/utilities';
4
6
  import { precompileTemplate } from '@ember/template-compilation';
5
7
  import { setComponentTemplate } from '@ember/component';
8
+ import { d as decorateFieldV2, i as initializeDeferredDecorator } from '../runtime-BPCpkOf1-B5Lbloj7.js';
6
9
 
7
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);
8
17
  get type() {
9
18
  if (this.args.type) {
10
19
  return this.args.type;
@@ -23,11 +32,20 @@ class Button extends Component {
23
32
  class: this.args.class
24
33
  });
25
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
+ };
26
43
  static {
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 ", {
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 ", {
28
45
  strictMode: true,
29
46
  scope: () => ({
30
- hash
47
+ hash,
48
+ press
31
49
  })
32
50
  }), this);
33
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sources":["../../src/components/button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\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' | 'custom';\n\n /**\n * The intent of the button\n */\n intent?: 'default' | 'primary' | '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\ninterface ButtonSignature {\n Args: ButtonArgs;\n Blocks: {\n default: [{ classNames: string }];\n };\n Element: HTMLButtonElement;\n}\n\nclass Button extends Component<ButtonSignature> {\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 <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 </template>\n}\n\nexport { Button, type ButtonSignature };\nexport default Button;\n"],"names":["Button","Component","type","args","classNames","button","useStyles","intent","size","appearance","isInGroup","class","setComponentTemplate","precompileTemplate","strictMode","scope","hash"],"mappings":";;;;;;AAsDA,MAAMA,eAAeC,SAAA,CAAU;EAC7B,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;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,gQAAA,EAQA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
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' | 'custom';\n\n /**\n * The intent of the button\n */\n intent?: 'default' | 'primary' | '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,EA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AAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -1,27 +1,35 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { action } from '@ember/object';
3
+ import { tracked } from '@glimmer/tracking';
3
4
  import { on } from '@ember/modifier';
4
- import { VisuallyHidden } from '@frontile/utilities';
5
+ import { deprecate } from '@ember/debug';
6
+ import { VisuallyHidden, press } from '@frontile/utilities';
5
7
  import { useStyles } from '@frontile/theme';
6
8
  import { precompileTemplate } from '@ember/template-compilation';
7
9
  import { setComponentTemplate } from '@ember/component';
10
+ import { d as decorateFieldV2, i as initializeDeferredDecorator, a as decorateMethodV2 } from '../runtime-BPCpkOf1-B5Lbloj7.js';
8
11
 
9
- function decorateMethodV2(prototype, prop, decorators) {
10
- const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);
11
- let desc = {
12
- ...origDesc
13
- };
14
- for (let decorator of decorators) {
15
- desc = decorator(prototype, prop, desc) || desc;
12
+ class CloseButton extends Component {
13
+ static {
14
+ decorateFieldV2(this.prototype, "isPressed", [tracked], function () {
15
+ return false;
16
+ });
16
17
  }
17
- if (desc.initializer !== void 0) {
18
- desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;
19
- desc.initializer = void 0;
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
+ }
20
32
  }
21
- Object.defineProperty(prototype, prop, desc);
22
- }
23
-
24
- class CloseButton extends Component {
25
33
  get classes() {
26
34
  const {
27
35
  closeButton
@@ -40,6 +48,17 @@ class CloseButton extends Component {
40
48
  icon: icon()
41
49
  };
42
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
+ }
43
62
  handleClick(event) {
44
63
  if (typeof this.args.onClick === 'function') {
45
64
  this.args.onClick(event);
@@ -49,9 +68,10 @@ class CloseButton extends Component {
49
68
  decorateMethodV2(this.prototype, "handleClick", [action]);
50
69
  }
51
70
  static {
52
- 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 ", {
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 ", {
53
72
  strictMode: true,
54
73
  scope: () => ({
74
+ press,
55
75
  on,
56
76
  VisuallyHidden
57
77
  })
@@ -1 +1 @@
1
- {"version":3,"file":"close-button.js","sources":["../../../../node_modules/.pnpm/decorator-transforms@2.3.0_@babel+core@7.26.7/node_modules/decorator-transforms/dist/runtime-BPCpkOf1.js","../../src/components/close-button.gts"],"sourcesContent":["const deferred = /* @__PURE__ */ new WeakMap();\nfunction deferDecorator(proto, prop, desc) {\n let map = deferred.get(proto);\n if (!map) {\n map = /* @__PURE__ */ new Map();\n deferred.set(proto, map);\n }\n map.set(prop, desc);\n}\nfunction findDeferredDecorator(target, prop) {\n var _a;\n let cursor = target.prototype;\n while (cursor) {\n let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);\n if (desc) {\n return desc;\n }\n cursor = cursor.prototype;\n }\n}\nfunction decorateFieldV1(target, prop, decorators, initializer) {\n return decorateFieldV2(target.prototype, prop, decorators, initializer);\n}\nfunction decorateFieldV2(prototype, prop, decorators, initializer) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n };\n if (initializer) {\n desc.initializer = initializer;\n }\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(prototype, prop, desc);\n } else {\n deferDecorator(prototype, prop, desc);\n }\n}\nfunction decorateMethodV1({ prototype }, prop, decorators) {\n return decorateMethodV2(prototype, prop, decorators);\n}\nfunction decorateMethodV2(prototype, prop, decorators) {\n const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);\n let desc = { ...origDesc };\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;\n desc.initializer = void 0;\n }\n Object.defineProperty(prototype, prop, desc);\n}\nfunction initializeDeferredDecorator(target, prop) {\n let desc = findDeferredDecorator(target.constructor, prop);\n if (desc) {\n Object.defineProperty(target, prop, {\n enumerable: desc.enumerable,\n configurable: desc.configurable,\n writable: desc.writable,\n value: desc.initializer ? desc.initializer.call(target) : void 0\n });\n }\n}\nfunction decorateClass(target, decorators) {\n return decorators.reduce(\n (accum, decorator) => decorator(accum) || accum,\n target\n );\n}\nfunction decoratePOJO(pojo, decorated) {\n for (let [type, prop, decorators] of decorated) {\n if (type === \"field\") {\n decoratePojoField(pojo, prop, decorators);\n } else {\n decorateMethodV2(pojo, prop, decorators);\n }\n }\n return pojo;\n}\nfunction decoratePojoField(pojo, prop, decorators) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: () => {\n var _a;\n return (_a = Object.getOwnPropertyDescriptor(pojo, prop)) == null ? void 0 : _a.value;\n }\n };\n for (let decorator of decorators) {\n desc = decorator(pojo, prop, desc) || desc;\n }\n if (desc.initializer) {\n desc.value = desc.initializer.call(pojo);\n delete desc.initializer;\n }\n Object.defineProperty(pojo, prop, desc);\n}\nconst runtime = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n c: decorateClass,\n f: decorateFieldV1,\n g: decorateFieldV2,\n i: initializeDeferredDecorator,\n m: decorateMethodV1,\n n: decorateMethodV2,\n p: decoratePOJO\n}, Symbol.toStringTag, { value: \"Module\" }));\nexport {\n decorateFieldV2 as a,\n decorateMethodV1 as b,\n decorateMethodV2 as c,\n decorateFieldV1 as d,\n decorateClass as e,\n decoratePOJO as f,\n initializeDeferredDecorator as i,\n runtime as r\n};\n//# sourceMappingURL=runtime-BPCpkOf1.js.map\n","import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { VisuallyHidden } from '@frontile/utilities';\nimport { useStyles, type CloseButtonVariants } from '@frontile/theme';\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 clicked\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 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 @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 ...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 </template>\n}\n\nexport { CloseButton, type CloseButtonSignature };\nexport default CloseButton;\n"],"names":["decorateMethodV2","prototype","prop","decorators","origDesc","Object","getOwnPropertyDescriptor","desc","decorator","initializer","value","call","defineProperty","CloseButton","Component","classes","closeButton","useStyles","base","icon","size","args","variant","class","handleClick","event","onClick","n","action","setComponentTemplate","precompileTemplate","strictMode","scope","on","VisuallyHidden"],"mappings":";;;;;;;;AAiGA,SAASA,iBACPC,SAAA,EACAC,IAAA,EACAC,UAAA,EACM;EACN,MAAMC,QAAA,GAAWC,MAAA,CAAOC,wBAAA,CAAyBL,SAAA,EAAWC,IAAI,CAAA;AAC5D,EAAA,IAAAK,IAAA,GAAmB;IAAE,GAAGH;AAAA,GAAA;EAC5B,KAAA,IAASI,SAAA,IAAaL,UAA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AA,CAAAC,kBAAA,CAAA,smBAAA,EAgCA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;","x_google_ignoreList":[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,CA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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,6 +1,6 @@
1
1
  import Component from '@glimmer/component';
2
- import { on } from '@ember/modifier';
3
2
  import { useStyles } from '@frontile/theme';
3
+ import { press } from '@frontile/utilities';
4
4
  import { precompileTemplate } from '@ember/template-compilation';
5
5
  import { setComponentTemplate } from '@ember/component';
6
6
 
@@ -27,10 +27,10 @@ class ToggleButton extends Component {
27
27
  }
28
28
  };
29
29
  static {
30
- setComponentTemplate(precompileTemplate("\n <button type=\"button\" {{on \"click\" this.onChange}} class={{this.classNames}} aria-pressed=\"{{this.isSelected}}\" ...attributes>\n {{yield}}\n </button>\n ", {
30
+ setComponentTemplate(precompileTemplate("\n <button type=\"button\" {{press this.onChange}} class={{this.classNames}} aria-pressed=\"{{this.isSelected}}\" ...attributes>\n {{yield}}\n </button>\n ", {
31
31
  strictMode: true,
32
32
  scope: () => ({
33
- on
33
+ press
34
34
  })
35
35
  }), this);
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-button.js","sources":["../../src/components/toggle-button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\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 {{on \"click\" 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","on"],"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,gLAAA,EAUA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
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;;;;"}
@@ -0,0 +1,67 @@
1
+ const deferred = /* @__PURE__ */new WeakMap();
2
+ function deferDecorator(proto, prop, desc) {
3
+ let map = deferred.get(proto);
4
+ if (!map) {
5
+ map = /* @__PURE__ */new Map();
6
+ deferred.set(proto, map);
7
+ }
8
+ map.set(prop, desc);
9
+ }
10
+ function findDeferredDecorator(target, prop) {
11
+ var _a;
12
+ let cursor = target.prototype;
13
+ while (cursor) {
14
+ let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);
15
+ if (desc) {
16
+ return desc;
17
+ }
18
+ cursor = cursor.prototype;
19
+ }
20
+ }
21
+ function decorateFieldV2(prototype, prop, decorators, initializer) {
22
+ let desc = {
23
+ configurable: true,
24
+ enumerable: true,
25
+ writable: true,
26
+ initializer: null
27
+ };
28
+ if (initializer) {
29
+ desc.initializer = initializer;
30
+ }
31
+ for (let decorator of decorators) {
32
+ desc = decorator(prototype, prop, desc) || desc;
33
+ }
34
+ if (desc.initializer === void 0) {
35
+ Object.defineProperty(prototype, prop, desc);
36
+ } else {
37
+ deferDecorator(prototype, prop, desc);
38
+ }
39
+ }
40
+ function decorateMethodV2(prototype, prop, decorators) {
41
+ const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);
42
+ let desc = {
43
+ ...origDesc
44
+ };
45
+ for (let decorator of decorators) {
46
+ desc = decorator(prototype, prop, desc) || desc;
47
+ }
48
+ if (desc.initializer !== void 0) {
49
+ desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;
50
+ desc.initializer = void 0;
51
+ }
52
+ Object.defineProperty(prototype, prop, desc);
53
+ }
54
+ function initializeDeferredDecorator(target, prop) {
55
+ let desc = findDeferredDecorator(target.constructor, prop);
56
+ if (desc) {
57
+ Object.defineProperty(target, prop, {
58
+ enumerable: desc.enumerable,
59
+ configurable: desc.configurable,
60
+ writable: desc.writable,
61
+ value: desc.initializer ? desc.initializer.call(target) : void 0
62
+ });
63
+ }
64
+ }
65
+
66
+ export { decorateMethodV2 as a, decorateFieldV2 as d, initializeDeferredDecorator as i };
67
+ //# sourceMappingURL=runtime-BPCpkOf1-B5Lbloj7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-BPCpkOf1-B5Lbloj7.js","sources":["../../../node_modules/.pnpm/decorator-transforms@2.3.0_@babel+core@7.26.7/node_modules/decorator-transforms/dist/runtime-BPCpkOf1.js"],"sourcesContent":["const deferred = /* @__PURE__ */ new WeakMap();\nfunction deferDecorator(proto, prop, desc) {\n let map = deferred.get(proto);\n if (!map) {\n map = /* @__PURE__ */ new Map();\n deferred.set(proto, map);\n }\n map.set(prop, desc);\n}\nfunction findDeferredDecorator(target, prop) {\n var _a;\n let cursor = target.prototype;\n while (cursor) {\n let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);\n if (desc) {\n return desc;\n }\n cursor = cursor.prototype;\n }\n}\nfunction decorateFieldV1(target, prop, decorators, initializer) {\n return decorateFieldV2(target.prototype, prop, decorators, initializer);\n}\nfunction decorateFieldV2(prototype, prop, decorators, initializer) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n };\n if (initializer) {\n desc.initializer = initializer;\n }\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(prototype, prop, desc);\n } else {\n deferDecorator(prototype, prop, desc);\n }\n}\nfunction decorateMethodV1({ prototype }, prop, decorators) {\n return decorateMethodV2(prototype, prop, decorators);\n}\nfunction decorateMethodV2(prototype, prop, decorators) {\n const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);\n let desc = { ...origDesc };\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;\n desc.initializer = void 0;\n }\n Object.defineProperty(prototype, prop, desc);\n}\nfunction initializeDeferredDecorator(target, prop) {\n let desc = findDeferredDecorator(target.constructor, prop);\n if (desc) {\n Object.defineProperty(target, prop, {\n enumerable: desc.enumerable,\n configurable: desc.configurable,\n writable: desc.writable,\n value: desc.initializer ? desc.initializer.call(target) : void 0\n });\n }\n}\nfunction decorateClass(target, decorators) {\n return decorators.reduce(\n (accum, decorator) => decorator(accum) || accum,\n target\n );\n}\nfunction decoratePOJO(pojo, decorated) {\n for (let [type, prop, decorators] of decorated) {\n if (type === \"field\") {\n decoratePojoField(pojo, prop, decorators);\n } else {\n decorateMethodV2(pojo, prop, decorators);\n }\n }\n return pojo;\n}\nfunction decoratePojoField(pojo, prop, decorators) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: () => {\n var _a;\n return (_a = Object.getOwnPropertyDescriptor(pojo, prop)) == null ? void 0 : _a.value;\n }\n };\n for (let decorator of decorators) {\n desc = decorator(pojo, prop, desc) || desc;\n }\n if (desc.initializer) {\n desc.value = desc.initializer.call(pojo);\n delete desc.initializer;\n }\n Object.defineProperty(pojo, prop, desc);\n}\nconst runtime = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n c: decorateClass,\n f: decorateFieldV1,\n g: decorateFieldV2,\n i: initializeDeferredDecorator,\n m: decorateMethodV1,\n n: decorateMethodV2,\n p: decoratePOJO\n}, Symbol.toStringTag, { value: \"Module\" }));\nexport {\n decorateFieldV2 as a,\n decorateMethodV1 as b,\n decorateMethodV2 as c,\n decorateFieldV1 as d,\n decorateClass as e,\n decoratePOJO as f,\n initializeDeferredDecorator as i,\n runtime as r\n};\n//# sourceMappingURL=runtime-BPCpkOf1.js.map\n"],"names":["deferred","WeakMap","deferDecorator","proto","prop","desc","map","get","Map","set","findDeferredDecorator","target","_a","cursor","prototype","decorateFieldV2","decorators","initializer","configurable","enumerable","writable","decorator","Object","defineProperty","decorateMethodV2","origDesc","getOwnPropertyDescriptor","value","call","initializeDeferredDecorator","constructor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AKc,UAAA;MACjBD,YAAA,EAAcb,IAAA,CAAKa,YAAA;MACnBE,QAAA,EAAUf,IAAA,CAAKe,QAAA;AACfO,MAAAA,KAAA,EAAOtB,IAAA,CAAKY,WAAA,GAAcZ,IAAA,CAAKY,WAAA,CAAYW,IAAA,CAAKjB,MAAM,CAAA,GAAI;KAC3D,CAAA;AACH,EAAA;AACF;;;;","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/buttons",
3
- "version": "0.17.0-beta.18",
3
+ "version": "0.17.0-beta.19",
4
4
  "description": "Component Library for Ember Octane apps: Buttons",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -53,8 +53,8 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@embroider/addon-shim": "^1.9.0",
56
- "@frontile/theme": "0.17.0-beta.18",
57
- "@frontile/utilities": "0.17.0-beta.18"
56
+ "@frontile/theme": "0.17.0-beta.19",
57
+ "@frontile/utilities": "0.17.0-beta.19"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@babel/core": "7.26.7",
@@ -104,5 +104,5 @@
104
104
  "./components/toggle-button.js": "./dist/_app_/components/toggle-button.js"
105
105
  }
106
106
  },
107
- "gitHead": "9f575cffe72db92a7a8a253f2322d45460c72355"
107
+ "gitHead": "cc99aa65d385f02d23a8aaacbab820ab48672e1e"
108
108
  }