frontile 0.18.0-alpha.6 → 0.18.0-alpha.8
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.
|
@@ -20,7 +20,7 @@ export interface ButtonArgs {
|
|
|
20
20
|
/**
|
|
21
21
|
* The size of the button
|
|
22
22
|
*/
|
|
23
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
|
|
23
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
24
24
|
/**
|
|
25
25
|
* Disable rendering the button element. It yields an object with classNames instead.
|
|
26
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../src/components/buttons/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 '../../modifiers/press';\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' | 'soft' | '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' | 'md' | 'lg' | 'xl' | '2xl'
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../src/components/buttons/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 '../../modifiers/press';\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' | 'soft' | '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' | 'md' | 'lg' | 'xl' | '2xl';\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":";;;;;;;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A,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frontile",
|
|
3
|
-
"version": "0.18.0-alpha.
|
|
3
|
+
"version": "0.18.0-alpha.8",
|
|
4
4
|
"description": "Component Library for Ember Octane apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -68,11 +68,24 @@
|
|
|
68
68
|
"declarations",
|
|
69
69
|
"dist"
|
|
70
70
|
],
|
|
71
|
+
"scripts": {
|
|
72
|
+
"build": "rollup --config",
|
|
73
|
+
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
|
|
74
|
+
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
|
|
75
|
+
"lint:js": "eslint . --cache",
|
|
76
|
+
"lint:js:fix": "eslint . --fix",
|
|
77
|
+
"lint:types": "glint",
|
|
78
|
+
"prepack": "concurrently 'npm:build'",
|
|
79
|
+
"start": "concurrently 'npm:start:*'",
|
|
80
|
+
"start:js": "rollup --config --watch --no-watch.clearScreen",
|
|
81
|
+
"start:types": "glint -d --watch",
|
|
82
|
+
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
|
|
83
|
+
},
|
|
71
84
|
"dependencies": {
|
|
72
85
|
"@ember/test-waiters": "^4.0.0",
|
|
73
86
|
"@embroider/addon-shim": "^1.9.0",
|
|
74
87
|
"@embroider/macros": "^1.16.10",
|
|
75
|
-
"@frontile/theme": "0.18.0-alpha.
|
|
88
|
+
"@frontile/theme": "^0.18.0-alpha.8",
|
|
76
89
|
"@glint/template": "^1.7.4",
|
|
77
90
|
"@universal-ember/table": "^3.1.1",
|
|
78
91
|
"ember-auto-import": "^2.7.2",
|
|
@@ -129,17 +142,5 @@
|
|
|
129
142
|
"./services/notifications.js": "./dist/_app_/services/notifications.js"
|
|
130
143
|
}
|
|
131
144
|
},
|
|
132
|
-
"gitHead": "
|
|
133
|
-
|
|
134
|
-
"build": "rollup --config",
|
|
135
|
-
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
|
|
136
|
-
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
|
|
137
|
-
"lint:js": "eslint . --cache",
|
|
138
|
-
"lint:js:fix": "eslint . --fix",
|
|
139
|
-
"lint:types": "glint",
|
|
140
|
-
"start": "concurrently 'npm:start:*'",
|
|
141
|
-
"start:js": "rollup --config --watch --no-watch.clearScreen",
|
|
142
|
-
"start:types": "glint -d --watch",
|
|
143
|
-
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
|
|
144
|
-
}
|
|
145
|
-
}
|
|
145
|
+
"gitHead": "4154e23134f1dcd7abe19a078cdc6096181639df"
|
|
146
|
+
}
|