@haiilo/catalyst 0.9.0 → 0.10.2
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/dist/catalyst/catalyst.css +1 -1
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.esm.js +1 -1
- package/dist/catalyst/{p-6a8a4dc0.js → p-8121572a.js} +3 -3
- package/dist/catalyst/p-8121572a.js.map +1 -0
- package/dist/catalyst/p-942b9736.entry.js +12 -0
- package/dist/catalyst/p-942b9736.entry.js.map +1 -0
- package/dist/catalyst/scss/_variables.scss +2 -1
- package/dist/catalyst/scss/core/_typography.scss +7 -7
- package/dist/catalyst/scss/index.scss +1 -5
- package/dist/cjs/{cat-alert_20.cjs.entry.js → cat-alert_21.cjs.entry.js} +152 -30
- package/dist/cjs/cat-alert_21.cjs.entry.js.map +1 -0
- package/dist/cjs/{cat-notification-fe237312.js → cat-notification-c2859ed7.js} +121 -1
- package/dist/cjs/cat-notification-c2859ed7.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +1 -5
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/index.cjs.js +3 -4
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -5
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/cat-button/cat-button.css +12 -11
- package/dist/collection/components/cat-card/cat-card.css +35 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.css +4 -0
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +23 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +3 -2
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.css +7 -0
- package/dist/collection/components/cat-radio/cat-radio.js +25 -2
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.css +12 -0
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +179 -0
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -0
- package/dist/collection/components/cat-select/cat-select.css +35 -20
- package/dist/collection/components/cat-select/cat-select.js +54 -14
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.css +4 -0
- package/dist/collection/components/cat-toggle/cat-toggle.js +25 -3
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/scss/_variables.scss +2 -1
- package/dist/collection/scss/core/_typography.scss +7 -7
- package/dist/collection/scss/index.scss +1 -5
- package/dist/components/cat-button2.js +1 -1
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-card.js +1 -1
- package/dist/components/cat-card.js.map +1 -1
- package/dist/components/cat-checkbox.js +7 -2
- package/dist/components/cat-checkbox.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +3 -2
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-radio-group.d.ts +11 -0
- package/dist/components/cat-radio-group.js +111 -0
- package/dist/components/cat-radio-group.js.map +1 -0
- package/dist/components/cat-radio.js +9 -3
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-select.js +41 -15
- package/dist/components/cat-select.js.map +1 -1
- package/dist/components/cat-toggle.js +8 -3
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -253
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{cat-alert_20.entry.js → cat-alert_21.entry.js} +149 -28
- package/dist/esm/cat-alert_21.entry.js.map +1 -0
- package/dist/esm/{cat-notification-a9655c00.js → cat-notification-3da6ddb1.js} +121 -3
- package/dist/esm/cat-notification-3da6ddb1.js.map +1 -0
- package/dist/esm/catalyst.js +1 -5
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -5
- package/dist/esm/loader.js.map +1 -1
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +4 -0
- package/dist/types/components/cat-radio/cat-radio.d.ts +4 -0
- package/dist/types/components/cat-radio-group/cat-radio-group.d.ts +29 -0
- package/dist/types/components/cat-select/cat-select.d.ts +7 -1
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +5 -1
- package/dist/types/components.d.ts +75 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/catalyst/p-0c1a611f.entry.js +0 -12
- package/dist/catalyst/p-0c1a611f.entry.js.map +0 -1
- package/dist/catalyst/p-6a8a4dc0.js.map +0 -1
- package/dist/catalyst/p-decdc6f1.js +0 -2
- package/dist/catalyst/p-decdc6f1.js.map +0 -1
- package/dist/catalyst/p-f45bcfd6.js +0 -2
- package/dist/catalyst/p-f45bcfd6.js.map +0 -1
- package/dist/cjs/app-globals-79765026.js +0 -256
- package/dist/cjs/app-globals-79765026.js.map +0 -1
- package/dist/cjs/cat-alert_20.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-b015a65f.js +0 -125
- package/dist/cjs/cat-icon-registry-b015a65f.js.map +0 -1
- package/dist/cjs/cat-notification-fe237312.js.map +0 -1
- package/dist/collection/init.js +0 -17
- package/dist/collection/init.js.map +0 -1
- package/dist/esm/app-globals-7d163b94.js +0 -254
- package/dist/esm/app-globals-7d163b94.js.map +0 -1
- package/dist/esm/cat-alert_20.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-dc1ef79a.js +0 -122
- package/dist/esm/cat-icon-registry-dc1ef79a.js.map +0 -1
- package/dist/esm/cat-notification-a9655c00.js.map +0 -1
- package/dist/types/init.d.ts +0 -1
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { l as loglevel } from './loglevel.js';
|
|
3
3
|
import { C as CatFormHint } from './cat-form-hint.js';
|
|
4
4
|
|
|
5
|
-
const catToggleCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;margin:0}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}input{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:#d7dbe0;transition:background-color 0.13s ease}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 32, 127, 138))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 0.13s linear;box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
|
|
5
|
+
const catToggleCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;margin:0}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.label-left{flex-direction:row-reverse}input{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:#d7dbe0;transition:background-color 0.13s ease}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 32, 127, 138))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 0.13s linear;box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
|
|
6
6
|
|
|
7
7
|
let nextUniqueId = 0;
|
|
8
8
|
const CatToggle$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -32,9 +32,13 @@ const CatToggle$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
32
32
|
*/
|
|
33
33
|
this.labelHidden = false;
|
|
34
34
|
/**
|
|
35
|
-
* Required state of the toggle
|
|
35
|
+
* Required state of the toggle.
|
|
36
36
|
*/
|
|
37
37
|
this.required = false;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the label should appear to the left of the toggle.
|
|
40
|
+
*/
|
|
41
|
+
this.labelLeft = false;
|
|
38
42
|
}
|
|
39
43
|
componentWillRender() {
|
|
40
44
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
@@ -52,7 +56,7 @@ const CatToggle$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
52
56
|
this.input.focus(options);
|
|
53
57
|
}
|
|
54
58
|
render() {
|
|
55
|
-
return (h(Host, null, h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled } }, h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), h("span", { class: "toggle", part: "toggle" }), h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), this.hintSection));
|
|
59
|
+
return (h(Host, null, h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), h("span", { class: "toggle", part: "toggle" }), h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), this.hintSection));
|
|
56
60
|
}
|
|
57
61
|
get hintSection() {
|
|
58
62
|
const hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
@@ -79,6 +83,7 @@ const CatToggle$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
79
83
|
"required": [4],
|
|
80
84
|
"value": [1025],
|
|
81
85
|
"hint": [1],
|
|
86
|
+
"labelLeft": [4, "label-left"],
|
|
82
87
|
"hasSlottedLabel": [32],
|
|
83
88
|
"setFocus": [64]
|
|
84
89
|
}]);
|
|
@@ -1 +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AC3B;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatToggle","log"],"sources":["./src/components/cat-toggle/cat-toggle.scss?tag=cat-toggle&encapsulation=shadow","./src/components/cat-toggle/cat-toggle.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@use 'src/components/cat-form-hint/cat-form-hint';\n\n:host {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin-bottom: $cat-body-margin-bottom;\n}\n\n:host([hidden]) {\n display: none;\n}\n\nlabel {\n flex: 0 1 auto;\n display: flex;\n gap: 0.5rem;\n @include cat-body('m');\n @include cat-select(none);\n cursor: pointer;\n}\n\n.label-left {\n flex-direction: row-reverse;\n}\n\ninput {\n @include cat-visually-hidden;\n}\n\n.toggle {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n width: 2rem;\n height: 1.25rem;\n border-radius: 10rem;\n background-color: cat-token('color.ui.border.input');\n transition: background-color cat-token('time.transition.s') ease;\n\n :checked + & {\n background-color: cat-token('color.theme.primary.bg');\n }\n\n :focus-visible + & {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n }\n\n &::after {\n content: '';\n position: absolute;\n width: 1rem;\n height: 1rem;\n background: #fff;\n border-radius: 10rem;\n transform: translateX(calc(2px - 0.5rem));\n transition: transform cat-token('time.transition.s') linear;\n @include cat-elevation(1);\n\n :checked + & {\n transform: translateX(calc(-2px + 0.5rem));\n }\n }\n}\n\n.label {\n flex: 1 1 auto;\n\n .is-hidden & {\n @include cat-visually-hidden;\n }\n}\n\n.is-disabled {\n cursor: not-allowed;\n color: cat-token('color.ui.font.muted');\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\n\nlet nextUniqueId = 0;\n\n/**\n * Toggles are graphical interface switches that give user control over a\n * feature or option that can be turned on or off.\n *\n * @slot hint - Optional hint element to be displayed with the toggle.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part toggle - The toggle element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-toggle',\n styleUrls: ['cat-toggle.scss'],\n shadow: true\n})\nexport class CatToggle {\n private readonly id = `cat-toggle-${nextUniqueId++}`;\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * Checked state of the toggle.\n */\n @Prop() checked = false;\n\n /**\n * Disabled state of the toggle.\n */\n @Prop() disabled = false;\n\n /**\n * The label of the toggle that is visible.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * The name of the input\n */\n @Prop() name?: string;\n\n /**\n * Required state of the toggle.\n */\n @Prop() required = false;\n\n /**\n * The value of the toggle\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * Optional hint text(s) to be displayed with the toggle.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the toggle.\n */\n @Prop() labelLeft = false;\n\n /**\n * Emitted when the checked status of the toggle is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the toggle received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the toggle loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.error('[A11y] Missing ARIA label on toggle', this);\n }\n }\n\n /**\n * Sets focus on the toggle. Use this method instead of `toggle.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n render() {\n return (\n <Host>\n <label\n htmlFor={this.id}\n class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }}\n >\n <input\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n class=\"form-check-input\"\n role=\"switch\"\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n <span class=\"toggle\" part=\"toggle\"></span>\n <span class=\"label\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {this.hintSection}\n </Host>\n );\n }\n\n private get hintSection() {\n const hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n return (\n (this.hint || hasSlottedHint) && (\n <CatFormHint hint={this.hint} slottedHint={hasSlottedHint && <slot name=\"hint\"></slot>} />\n )\n );\n }\n\n private onInput(event: Event) {\n this.value = this.input.value;\n this.catChange.emit(event);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n}\n"],"version":3}
|
|
@@ -10,6 +10,7 @@ export { CatInput as CatInput } from '../types/components/cat-input/cat-input';
|
|
|
10
10
|
export { CatMenu as CatMenu } from '../types/components/cat-menu/cat-menu';
|
|
11
11
|
export { CatModal as CatModal } from '../types/components/cat-modal/cat-modal';
|
|
12
12
|
export { CatRadio as CatRadio } from '../types/components/cat-radio/cat-radio';
|
|
13
|
+
export { CatRadioGroup as CatRadioGroup } from '../types/components/cat-radio-group/cat-radio-group';
|
|
13
14
|
export { CatScrollable as CatScrollable } from '../types/components/cat-scrollable/cat-scrollable';
|
|
14
15
|
export { CatSelect as CatSelect } from '../types/components/cat-select/cat-select';
|
|
15
16
|
export { CatSkeleton as CatSkeleton } from '../types/components/cat-skeleton/cat-skeleton';
|