@haiilo/catalyst 7.0.0 → 7.1.0
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 +138 -21
- 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-44042184.entry.js +10 -0
- package/dist/catalyst/p-44042184.entry.js.map +1 -0
- package/dist/catalyst/p-85d057f0.js +2 -0
- package/dist/catalyst/p-85d057f0.js.map +1 -0
- package/dist/catalyst/scss/core/_form.scss +6 -0
- package/dist/catalyst/scss/core/_typography.scss +19 -18
- package/dist/catalyst/scss/utils/_color.scss +24 -0
- package/dist/cjs/cat-alert_26.cjs.entry.js +13 -9
- package/dist/cjs/cat-alert_26.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{of-8545b523.js → of-395b2f57.js} +6 -2
- package/dist/cjs/of-395b2f57.js.map +1 -0
- package/dist/collection/components/cat-alert/cat-alert.css +29 -0
- package/dist/collection/components/cat-alert/cat-alert.js +2 -0
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.css +6 -0
- package/dist/collection/components/cat-badge/cat-badge.js +2 -2
- package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.css +17 -0
- package/dist/collection/components/cat-button/cat-button.js +2 -2
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +27 -9
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +3 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +107 -0
- package/dist/collection/components/cat-select/cat-select.css +107 -0
- package/dist/collection/components/cat-select/cat-select.js +4 -4
- package/dist/collection/components/cat-textarea/cat-textarea.css +107 -0
- package/dist/collection/components/cat-toggle/cat-toggle.js +28 -10
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/scss/core/_form.scss +6 -0
- package/dist/collection/scss/core/_typography.scss +19 -18
- package/dist/collection/scss/utils/_color.scss +24 -0
- package/dist/components/cat-alert.js +3 -1
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-badge.js +1 -1
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button2.js +1 -1
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-checkbox2.js +4 -2
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-icon-registry.js +5 -1
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-input2.js +1 -1
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-select2.js +1 -1
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-textarea.js +1 -1
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-toggle.js +4 -2
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/esm/cat-alert_26.entry.js +13 -9
- package/dist/esm/cat-alert_26.entry.js.map +1 -1
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{of-a965d8fb.js → of-04d3d9e1.js} +6 -2
- package/dist/esm/of-04d3d9e1.js.map +1 -0
- package/dist/types/components/cat-badge/cat-badge.d.ts +1 -1
- package/dist/types/components/cat-button/cat-button.d.ts +1 -1
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +8 -4
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +9 -5
- package/dist/types/components.d.ts +36 -20
- package/package.json +2 -2
- package/dist/catalyst/p-19fad7af.js +0 -2
- package/dist/catalyst/p-19fad7af.js.map +0 -1
- package/dist/catalyst/p-5dab6694.entry.js +0 -10
- package/dist/catalyst/p-5dab6694.entry.js.map +0 -1
- package/dist/cjs/of-8545b523.js.map +0 -1
- package/dist/esm/of-a965d8fb.js.map +0 -1
|
@@ -185,6 +185,23 @@
|
|
|
185
185
|
--text: var(--cat-secondary-text-active, 0, 0, 0);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
.cat-button-info {
|
|
189
|
+
--bg: var(--cat-success-bg, 0, 115, 230);
|
|
190
|
+
--fill: var(--cat-success-fill, 255, 255, 255);
|
|
191
|
+
--text: var(--cat-success-text, 0, 115, 230);
|
|
192
|
+
--base: var(--cat-success-text, 0, 115, 230);
|
|
193
|
+
}
|
|
194
|
+
.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading) {
|
|
195
|
+
--bg: var(--cat-success-bg-hover, 0, 107, 227);
|
|
196
|
+
--fill: var(--cat-success-fill-hover, 255, 255, 255);
|
|
197
|
+
--text: var(--cat-success-text-hover, 0, 107, 227);
|
|
198
|
+
}
|
|
199
|
+
.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading), .cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading) {
|
|
200
|
+
--bg: var(--cat-success-bg-active, 0, 96, 223);
|
|
201
|
+
--fill: var(--cat-success-fill-active, 255, 255, 255);
|
|
202
|
+
--text: var(--cat-success-text-active, 0, 96, 223);
|
|
203
|
+
}
|
|
204
|
+
|
|
188
205
|
.cat-button-success {
|
|
189
206
|
--bg: var(--cat-success-bg, 0, 132, 88);
|
|
190
207
|
--fill: var(--cat-success-fill, 255, 255, 255);
|
|
@@ -202,8 +202,8 @@ export class CatButton {
|
|
|
202
202
|
"type": "string",
|
|
203
203
|
"mutable": false,
|
|
204
204
|
"complexType": {
|
|
205
|
-
"original": "'primary' | 'secondary' | '
|
|
206
|
-
"resolved": "\"danger\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"",
|
|
205
|
+
"original": "'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger'",
|
|
206
|
+
"resolved": "\"danger\" | \"info\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"",
|
|
207
207
|
"references": {}
|
|
208
208
|
},
|
|
209
209
|
"required": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-button.js","sourceRoot":"","sources":["../../../src/components/cat-button/cat-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;GAQG;AAMH,MAAM,OAAO,SAAS;;qBAMC,IAAI;mBAKkC,UAAU;iBAKO,WAAW;kBAKtE,KAAK;gBAKwB,GAAG;;;oBAoB9B,KAAK;mBAON,KAAK;kBAKN,KAAK;sBAKD,KAAK;iBAKV,KAAK;;;;oBAoBoB,KAAK;qBAK1B,KAAK;;;;;;;;EAqCzB,iBAAiB,CAAC,KAA2B;IAC3C,WAAW;IACX,oEAAoE;IACpE,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,kBAAmB,CAAC,CAAC;IAC7E,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;IAChC,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACpC,QAAQ;IACR,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;MACvB,IAAI,CAAC,YAAY,KAAjB,IAAI,CAAC,YAAY,GAAK,IAAI,YAAY,EAAE,EAAC;MACzC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { Breakpoint, Breakpoints, isBreakpoint } from '../../utils/breakpoints';\nimport { MediaMatcher } from '../../utils/media-matcher';\n\n/**\n * Buttons are used for interface actions. Primary style should be used only\n * once per view for main call-to-action.\n *\n * @part button - The native anchor or button element.\n * @part content - The textual content of the button.\n * @part prefix - The prefix icon.\n * @part suffix - The suffix icon.\n */\n@Component({\n tag: 'cat-button',\n styleUrl: 'cat-button.scss',\n shadow: true\n})\nexport class CatButton {\n private button!: HTMLButtonElement | HTMLAnchorElement;\n private mediaMatcher?: MediaMatcher;\n private mediaQueryList?: MediaQueryList;\n private mediaQueryListener?: (event: MediaQueryListEvent) => void;\n\n @State() _iconOnly = true;\n\n /**\n * The rendering style of the button.\n */\n @Prop() variant: 'filled' | 'outlined' | 'text' | 'link' = 'outlined';\n\n /**\n * The color palette of the button.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'secondary';\n\n /**\n * Set the button into an active state.\n */\n @Prop() active = false;\n\n /**\n * The size of the button.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * The name of the button, which gets paired with the button's value when\n * submitted as part of a form. Corresponds with the native HTML name\n * attribute.\n */\n @Prop() name?: string;\n\n /**\n * The value of the button, which gets paired with the button's name when\n * submitted as part of a form. Corresponds with the native HTML value\n * attribute.\n */\n @Prop() value?: string;\n\n /**\n * Specifies that the button should be disabled. A disabled button is unusable\n * and un-clickable. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * Displays the button in a loading state with a spinner. Just like a disabled\n * button, an inactive button is unusable and un-clickable. However, it\n * retains the current focus state.\n */\n @Prop() loading = false;\n\n /**\n * Allows the button to submit a form.\n */\n @Prop() submit = false;\n\n /**\n * Disables ellipse overflowing button content.\n */\n @Prop() noEllipsis = false;\n\n /**\n * Use round button edges.\n */\n @Prop() round = false;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop() url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop() urlTarget?: '_blank' | '_self';\n\n /**\n * The name of an icon to be displayed in the button.\n */\n @Prop() icon?: string;\n\n /**\n * Hide the actual button content and only display the icon.\n */\n @Prop() iconOnly: boolean | Breakpoint = false;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * Adds a unique identifier for the button. Please note that with this\n * particular component this ID is added inside the web component. If you need\n * an ID on the HTML element, use the regular `id` attribute instead.\n */\n @Prop() buttonId?: string;\n\n /**\n * Adds accessible label for the button that is only shown for screen\n * readers. Typically, this label text replaces the visible text on the\n * button for users who use assistive technology.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n /**\n * Sets the `aria-current` attribute on the button.\n */\n @Prop({ attribute: 'a11y-current' }) a11yCurrent?: string;\n\n /**\n * Attributes that will be added to the native HTML button element\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Attributes that will be added to the native HTML button content element\n */\n @Prop() nativeContentAttributes?: { [key: string]: string };\n\n /**\n * The index of a button that is used inside a cat-button-group component\n */\n @Prop() buttonGroupPosition?: 'first' | 'last' | 'middle';\n\n @Watch('iconOnly')\n onIconOnlyChanged(value: boolean | Breakpoint): void {\n // teardown\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.mediaQueryList?.removeEventListener('change', this.mediaQueryListener!);\n this.mediaQueryList = undefined;\n this.mediaQueryListener = undefined;\n // setup\n if (isBreakpoint(value)) {\n this.mediaMatcher ??= new MediaMatcher();\n this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);\n this.mediaQueryListener = (event: MediaQueryListEvent) => (this._iconOnly = event.matches);\n this.mediaQueryList.addEventListener('change', this.mediaQueryListener);\n this._iconOnly = this.mediaQueryList.matches;\n } else {\n this._iconOnly = value;\n }\n }\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() catClick!: EventEmitter<MouseEvent>;\n\n /**\n * Emitted when the button received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the button loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad(): void {\n this.onIconOnlyChanged(this.iconOnly);\n }\n\n componentWillRender(): void {\n if (this.isIconButton && !this.a11yLabel) {\n log.warn('[A11y] Missing ARIA label on icon button', this);\n }\n }\n\n @Listen('click')\n haltDisabledEvents(event: Event): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n /**\n * Programmatically move focus to the button. Use this method instead of\n * `button.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.button.focus(options);\n }\n\n /**\n * Programmatically remove focus from the button. Use this method instead of\n * `button.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.button.blur();\n }\n\n /**\n * Programmatically simulate a click on the button.\n */\n @Method()\n async doClick(): Promise<void> {\n this.button.click();\n }\n\n render() {\n if (this.url) {\n return (\n <a\n {...this.nativeAttributes}\n ref={el => (this.button = el as HTMLAnchorElement)}\n href={this.disabled ? undefined : this.url}\n target={this.urlTarget}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </a>\n );\n } else {\n return (\n <button\n {...this.nativeAttributes}\n ref={el => (this.button = el as HTMLButtonElement)}\n type={this.submit ? 'submit' : 'button'}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round ?? this.isIconButton,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size),\n [`cat-group-button-${this.buttonGroupPosition}`]: Boolean(this.buttonGroupPosition),\n 'cat-group-button': Boolean(this.buttonGroupPosition)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </button>\n );\n }\n }\n\n private get iconSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 's';\n default:\n return 'l';\n }\n }\n\n private get spinnerSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 'xs';\n default:\n return 'm';\n }\n }\n\n private get isIconButton() {\n return Boolean(this.icon) && this._iconOnly;\n }\n\n private get hasPrefixIcon() {\n return Boolean(this.icon) && !this._iconOnly && !this.iconRight;\n }\n\n private get hasSuffixIcon() {\n return Boolean(this.icon) && !this._iconOnly && this.iconRight;\n }\n\n private get content() {\n return [\n this.hasPrefixIcon ? <cat-icon icon={this.icon} size={this.iconSize} part=\"prefix\"></cat-icon> : null,\n this.isIconButton ? (\n <cat-icon icon={this.icon} size={this.iconSize}></cat-icon>\n ) : (\n <span class=\"cat-button-content\" part=\"content\" {...this.nativeContentAttributes}>\n <span class=\"cat-button-content-inner\">\n <slot></slot>\n </span>\n </span>\n ),\n this.hasSuffixIcon ? <cat-icon icon={this.icon} size={this.iconSize} part=\"suffix\"></cat-icon> : null,\n this.loading ? <cat-spinner size={this.spinnerSize}></cat-spinner> : null\n ];\n }\n\n private onClick(event: MouseEvent) {\n this.catClick.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"]}
|
|
1
|
+
{"version":3,"file":"cat-button.js","sourceRoot":"","sources":["../../../src/components/cat-button/cat-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;GAQG;AAMH,MAAM,OAAO,SAAS;;qBAMC,IAAI;mBAKkC,UAAU;iBAKgB,WAAW;kBAK/E,KAAK;gBAKwB,GAAG;;;oBAoB9B,KAAK;mBAON,KAAK;kBAKN,KAAK;sBAKD,KAAK;iBAKV,KAAK;;;;oBAoBoB,KAAK;qBAK1B,KAAK;;;;;;;;EAqCzB,iBAAiB,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,KAAK,CAAC,CAAC;EAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { Breakpoint, Breakpoints, isBreakpoint } from '../../utils/breakpoints';\nimport { MediaMatcher } from '../../utils/media-matcher';\n\n/**\n * Buttons are used for interface actions. Primary style should be used only\n * once per view for main call-to-action.\n *\n * @part button - The native anchor or button element.\n * @part content - The textual content of the button.\n * @part prefix - The prefix icon.\n * @part suffix - The suffix icon.\n */\n@Component({\n tag: 'cat-button',\n styleUrl: 'cat-button.scss',\n shadow: true\n})\nexport class CatButton {\n private button!: HTMLButtonElement | HTMLAnchorElement;\n private mediaMatcher?: MediaMatcher;\n private mediaQueryList?: MediaQueryList;\n private mediaQueryListener?: (event: MediaQueryListEvent) => void;\n\n @State() _iconOnly = true;\n\n /**\n * The rendering style of the button.\n */\n @Prop() variant: 'filled' | 'outlined' | 'text' | 'link' = 'outlined';\n\n /**\n * The color palette of the button.\n */\n @Prop() color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger' = 'secondary';\n\n /**\n * Set the button into an active state.\n */\n @Prop() active = false;\n\n /**\n * The size of the button.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * The name of the button, which gets paired with the button's value when\n * submitted as part of a form. Corresponds with the native HTML name\n * attribute.\n */\n @Prop() name?: string;\n\n /**\n * The value of the button, which gets paired with the button's name when\n * submitted as part of a form. Corresponds with the native HTML value\n * attribute.\n */\n @Prop() value?: string;\n\n /**\n * Specifies that the button should be disabled. A disabled button is unusable\n * and un-clickable. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * Displays the button in a loading state with a spinner. Just like a disabled\n * button, an inactive button is unusable and un-clickable. However, it\n * retains the current focus state.\n */\n @Prop() loading = false;\n\n /**\n * Allows the button to submit a form.\n */\n @Prop() submit = false;\n\n /**\n * Disables ellipse overflowing button content.\n */\n @Prop() noEllipsis = false;\n\n /**\n * Use round button edges.\n */\n @Prop() round = false;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop() url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop() urlTarget?: '_blank' | '_self';\n\n /**\n * The name of an icon to be displayed in the button.\n */\n @Prop() icon?: string;\n\n /**\n * Hide the actual button content and only display the icon.\n */\n @Prop() iconOnly: boolean | Breakpoint = false;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * Adds a unique identifier for the button. Please note that with this\n * particular component this ID is added inside the web component. If you need\n * an ID on the HTML element, use the regular `id` attribute instead.\n */\n @Prop() buttonId?: string;\n\n /**\n * Adds accessible label for the button that is only shown for screen\n * readers. Typically, this label text replaces the visible text on the\n * button for users who use assistive technology.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n /**\n * Sets the `aria-current` attribute on the button.\n */\n @Prop({ attribute: 'a11y-current' }) a11yCurrent?: string;\n\n /**\n * Attributes that will be added to the native HTML button element\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Attributes that will be added to the native HTML button content element\n */\n @Prop() nativeContentAttributes?: { [key: string]: string };\n\n /**\n * The index of a button that is used inside a cat-button-group component\n */\n @Prop() buttonGroupPosition?: 'first' | 'last' | 'middle';\n\n @Watch('iconOnly')\n onIconOnlyChanged(value: boolean | Breakpoint): void {\n // teardown\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.mediaQueryList?.removeEventListener('change', this.mediaQueryListener!);\n this.mediaQueryList = undefined;\n this.mediaQueryListener = undefined;\n // setup\n if (isBreakpoint(value)) {\n this.mediaMatcher ??= new MediaMatcher();\n this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);\n this.mediaQueryListener = (event: MediaQueryListEvent) => (this._iconOnly = event.matches);\n this.mediaQueryList.addEventListener('change', this.mediaQueryListener);\n this._iconOnly = this.mediaQueryList.matches;\n } else {\n this._iconOnly = value;\n }\n }\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() catClick!: EventEmitter<MouseEvent>;\n\n /**\n * Emitted when the button received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the button loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad(): void {\n this.onIconOnlyChanged(this.iconOnly);\n }\n\n componentWillRender(): void {\n if (this.isIconButton && !this.a11yLabel) {\n log.warn('[A11y] Missing ARIA label on icon button', this);\n }\n }\n\n @Listen('click')\n haltDisabledEvents(event: Event): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n /**\n * Programmatically move focus to the button. Use this method instead of\n * `button.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.button.focus(options);\n }\n\n /**\n * Programmatically remove focus from the button. Use this method instead of\n * `button.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.button.blur();\n }\n\n /**\n * Programmatically simulate a click on the button.\n */\n @Method()\n async doClick(): Promise<void> {\n this.button.click();\n }\n\n render() {\n if (this.url) {\n return (\n <a\n {...this.nativeAttributes}\n ref={el => (this.button = el as HTMLAnchorElement)}\n href={this.disabled ? undefined : this.url}\n target={this.urlTarget}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </a>\n );\n } else {\n return (\n <button\n {...this.nativeAttributes}\n ref={el => (this.button = el as HTMLButtonElement)}\n type={this.submit ? 'submit' : 'button'}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round ?? this.isIconButton,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size),\n [`cat-group-button-${this.buttonGroupPosition}`]: Boolean(this.buttonGroupPosition),\n 'cat-group-button': Boolean(this.buttonGroupPosition)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </button>\n );\n }\n }\n\n private get iconSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 's';\n default:\n return 'l';\n }\n }\n\n private get spinnerSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 'xs';\n default:\n return 'm';\n }\n }\n\n private get isIconButton() {\n return Boolean(this.icon) && this._iconOnly;\n }\n\n private get hasPrefixIcon() {\n return Boolean(this.icon) && !this._iconOnly && !this.iconRight;\n }\n\n private get hasSuffixIcon() {\n return Boolean(this.icon) && !this._iconOnly && this.iconRight;\n }\n\n private get content() {\n return [\n this.hasPrefixIcon ? <cat-icon icon={this.icon} size={this.iconSize} part=\"prefix\"></cat-icon> : null,\n this.isIconButton ? (\n <cat-icon icon={this.icon} size={this.iconSize}></cat-icon>\n ) : (\n <span class=\"cat-button-content\" part=\"content\" {...this.nativeContentAttributes}>\n <span class=\"cat-button-content-inner\">\n <slot></slot>\n </span>\n </span>\n ),\n this.hasSuffixIcon ? <cat-icon icon={this.icon} size={this.iconSize} part=\"suffix\"></cat-icon> : null,\n this.loading ? <cat-spinner size={this.spinnerSize}></cat-spinner> : null\n ];\n }\n\n private onClick(event: MouseEvent) {\n this.catClick.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"]}
|
|
@@ -25,6 +25,7 @@ export class CatCheckbox {
|
|
|
25
25
|
this.name = undefined;
|
|
26
26
|
this.required = false;
|
|
27
27
|
this.value = undefined;
|
|
28
|
+
this.noValue = undefined;
|
|
28
29
|
this.resolvedValue = null;
|
|
29
30
|
this.hint = undefined;
|
|
30
31
|
this.labelLeft = false;
|
|
@@ -79,7 +80,7 @@ export class CatCheckbox {
|
|
|
79
80
|
this.catBlur.emit(event);
|
|
80
81
|
}
|
|
81
82
|
updateResolved() {
|
|
82
|
-
this.resolvedValue = this.
|
|
83
|
+
this.resolvedValue = this.checked ? this.value ?? true : this.noValue ?? false;
|
|
83
84
|
}
|
|
84
85
|
static get is() { return "cat-checkbox"; }
|
|
85
86
|
static get encapsulation() { return "shadow"; }
|
|
@@ -238,28 +239,45 @@ export class CatCheckbox {
|
|
|
238
239
|
"defaultValue": "false"
|
|
239
240
|
},
|
|
240
241
|
"value": {
|
|
241
|
-
"type": "
|
|
242
|
+
"type": "any",
|
|
242
243
|
"mutable": false,
|
|
243
244
|
"complexType": {
|
|
244
|
-
"original": "
|
|
245
|
-
"resolved": "
|
|
245
|
+
"original": "any",
|
|
246
|
+
"resolved": "any",
|
|
246
247
|
"references": {}
|
|
247
248
|
},
|
|
248
249
|
"required": false,
|
|
249
250
|
"optional": true,
|
|
250
251
|
"docs": {
|
|
251
252
|
"tags": [],
|
|
252
|
-
"text": "The value of the checkbox."
|
|
253
|
+
"text": "The value of the checked checkbox."
|
|
253
254
|
},
|
|
254
255
|
"attribute": "value",
|
|
255
256
|
"reflect": false
|
|
256
257
|
},
|
|
258
|
+
"noValue": {
|
|
259
|
+
"type": "any",
|
|
260
|
+
"mutable": false,
|
|
261
|
+
"complexType": {
|
|
262
|
+
"original": "any",
|
|
263
|
+
"resolved": "any",
|
|
264
|
+
"references": {}
|
|
265
|
+
},
|
|
266
|
+
"required": false,
|
|
267
|
+
"optional": true,
|
|
268
|
+
"docs": {
|
|
269
|
+
"tags": [],
|
|
270
|
+
"text": "The value of the unchecked checkbox."
|
|
271
|
+
},
|
|
272
|
+
"attribute": "no-value",
|
|
273
|
+
"reflect": false
|
|
274
|
+
},
|
|
257
275
|
"resolvedValue": {
|
|
258
276
|
"type": "any",
|
|
259
277
|
"mutable": true,
|
|
260
278
|
"complexType": {
|
|
261
|
-
"original": "
|
|
262
|
-
"resolved": "
|
|
279
|
+
"original": "any",
|
|
280
|
+
"resolved": "any",
|
|
263
281
|
"references": {}
|
|
264
282
|
},
|
|
265
283
|
"required": false,
|
|
@@ -342,8 +360,8 @@ export class CatCheckbox {
|
|
|
342
360
|
"text": "Emitted when the checked status of the checkbox is changed."
|
|
343
361
|
},
|
|
344
362
|
"complexType": {
|
|
345
|
-
"original": "
|
|
346
|
-
"resolved": "
|
|
363
|
+
"original": "any",
|
|
364
|
+
"resolved": "any",
|
|
347
365
|
"references": {}
|
|
348
366
|
}
|
|
349
367
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-checkbox.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;GAQG;AAMH,MAAM,OAAO,WAAW;;IACL,QAAG,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;2BAS7B,KAAK;0BACN,KAAK;mBAKI,KAAK;yBAKC,KAAK;oBAK3B,KAAK;;iBAUR,EAAE;uBAKI,KAAK;;oBAUR,KAAK
|
|
1
|
+
{"version":3,"file":"cat-checkbox.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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 * Checkboxes are used to let a user choose one or more options from a limited\n * number of options.\n *\n * @slot hint - Optional hint element to be displayed with the checkbox.\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 checkbox - The checkbox element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-checkbox',\n styleUrls: ['cat-checkbox.scss'],\n shadow: true\n})\nexport class CatCheckbox {\n private readonly _id = `cat-checkbox-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n @State() hasSlottedHint = false;\n\n /**\n * Checked state of the checkbox\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Indeterminate state of the checkbox\n */\n @Prop({ mutable: true }) indeterminate = false;\n\n /**\n * Disabled state of the checkbox\n */\n @Prop() disabled = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * Label of the checkbox which is presented in the UI\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 checkbox.\n */\n @Prop() required = false;\n\n /**\n * The value of the checked checkbox.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop() value?: any;\n\n /**\n * The value of the unchecked checkbox.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop() noValue?: any;\n\n /**\n * The resolved value of the checkbox, based on the checked state and value.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop({ mutable: true }) resolvedValue: any = null;\n\n /**\n * Optional hint text(s) to be displayed with the checkbox.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the checkbox.\n */\n @Prop() labelLeft = false;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the checked status of the checkbox is changed.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Event() catChange!: EventEmitter<any>;\n\n /**\n * Emitted when the checkbox received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad() {\n this.updateResolved();\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on checkbox', this);\n }\n }\n\n /**\n * Programmatically move focus to the checkbox. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the checkbox. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\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 {...this.nativeAttributes}\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 indeterminate={this.indeterminate}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-describedby={this.hasHint ? this.id + '-hint' : undefined}\n />\n <span class=\"box\" aria-hidden=\"true\" part=\"checkbox\">\n <svg class=\"check\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 6 4.5 9 10.5 1\"></polyline>\n </svg>\n <svg class=\"dash\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 5 10.5 5\"></polyline>\n </svg>\n </span>\n <span class=\"label\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {this.hasHint && (\n <div class={{ 'hint-wrapper': true, 'label-left': this.labelLeft }}>\n <div class=\"box-placeholder\"></div>\n <CatFormHint id={this.id} hint={this.hint} slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>} />\n </div>\n )}\n </Host>\n );\n }\n\n private get hasHint() {\n return !!this.hint || !!this.hasSlottedHint;\n }\n\n private onInput() {\n this.checked = this.input.checked;\n this.indeterminate = this.input.indeterminate;\n this.updateResolved();\n this.catChange.emit(this.resolvedValue);\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 private updateResolved() {\n this.resolvedValue = this.checked ? this.value ?? true : this.noValue ?? false;\n }\n}\n"]}
|
|
@@ -9,6 +9,7 @@ import crossCircleFilled from "@haiilo/catalyst-icons/tmp/assets/cross-circle-fi
|
|
|
9
9
|
import crossCircleOutlined from "@haiilo/catalyst-icons/tmp/assets/cross-circle-outlined.svg";
|
|
10
10
|
import crossOutlined from "@haiilo/catalyst-icons/tmp/assets/cross-outlined.svg";
|
|
11
11
|
import dangerFilled from "@haiilo/catalyst-icons/tmp/assets/danger-filled.svg";
|
|
12
|
+
import infoCircleFilled from "@haiilo/catalyst-icons/tmp/assets/info-circle-filled.svg";
|
|
12
13
|
import starCircleFilled from "@haiilo/catalyst-icons/tmp/assets/star-circle-filled.svg";
|
|
13
14
|
import log from "loglevel";
|
|
14
15
|
export class CatIconRegistry {
|
|
@@ -18,11 +19,12 @@ export class CatIconRegistry {
|
|
|
18
19
|
this.icons = new Map();
|
|
19
20
|
// register default icons that are used in the framework by other components
|
|
20
21
|
this.addIcons({
|
|
21
|
-
'alert-danger': crossCircleFilled,
|
|
22
22
|
'alert-primary': starCircleFilled,
|
|
23
23
|
'alert-secondary': clockFilled,
|
|
24
|
+
'alert-info': infoCircleFilled,
|
|
24
25
|
'alert-success': checkCircleFilled,
|
|
25
26
|
'alert-warning': dangerFilled,
|
|
27
|
+
'alert-danger': crossCircleFilled,
|
|
26
28
|
'dialog-close': crossOutlined,
|
|
27
29
|
'input-close': crossCircleOutlined,
|
|
28
30
|
'input-error': alertCircleOutlined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-icon-registry.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon-registry.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gDAAgD,CAAC;AACrE,OAAO,mBAAmB,MAAM,6DAA6D,CAAC;AAC9F,OAAO,iBAAiB,MAAM,2DAA2D,CAAC;AAC1F,OAAO,mBAAmB,MAAM,6DAA6D,CAAC;AAC9F,OAAO,mBAAmB,MAAM,6DAA6D,CAAC;AAC9F,OAAO,oBAAoB,MAAM,8DAA8D,CAAC;AAChG,OAAO,WAAW,MAAM,oDAAoD,CAAC;AAC7E,OAAO,iBAAiB,MAAM,2DAA2D,CAAC;AAC1F,OAAO,mBAAmB,MAAM,6DAA6D,CAAC;AAC9F,OAAO,aAAa,MAAM,sDAAsD,CAAC;AACjF,OAAO,YAAY,MAAM,qDAAqD,CAAC;AAC/E,OAAO,gBAAgB,MAAM,0DAA0D,CAAC;AACxF,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,MAAM,OAA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ED,WAAW,CAAC,KAAe,EAAE,OAAgB,EAAE,MAAM,GAAG,KAAK;IAC3D,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9B,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACxE,GAAG,CAAC,IAAI,CAAC,6BAA6B,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACnH,CAAC,MAAM,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACvG,OAAO,IAAI,CAAC;EACd,CAAC;EAEO,SAAS,CAAC,IAAY,EAAE,OAAgB;IAC9C,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;EAC/C,CAAC;EAEO,UAAU,CAAI,IAAY,EAAE,MAAU;IAC5C,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE;MAC3B,OAAO,EAAE,IAAI;MACb,QAAQ,EAAE,IAAI;MACd,MAAM;KACP,CAAC,CAAC;EACL,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import cross16 from '@haiilo/catalyst-icons/tmp/assets/16-cross.svg';\nimport alertCircleOutlined from '@haiilo/catalyst-icons/tmp/assets/alert-circle-outlined.svg';\nimport checkCircleFilled from '@haiilo/catalyst-icons/tmp/assets/check-circle-filled.svg';\nimport chevronDownOutlined from '@haiilo/catalyst-icons/tmp/assets/chevron-down-outlined.svg';\nimport chevronLeftOutlined from '@haiilo/catalyst-icons/tmp/assets/chevron-left-outlined.svg';\nimport chevronRightOutlined from '@haiilo/catalyst-icons/tmp/assets/chevron-right-outlined.svg';\nimport clockFilled from '@haiilo/catalyst-icons/tmp/assets/clock-filled.svg';\nimport crossCircleFilled from '@haiilo/catalyst-icons/tmp/assets/cross-circle-filled.svg';\nimport crossCircleOutlined from '@haiilo/catalyst-icons/tmp/assets/cross-circle-outlined.svg';\nimport crossOutlined from '@haiilo/catalyst-icons/tmp/assets/cross-outlined.svg';\nimport dangerFilled from '@haiilo/catalyst-icons/tmp/assets/danger-filled.svg';\nimport infoCircleFilled from '@haiilo/catalyst-icons/tmp/assets/info-circle-filled.svg';\nimport starCircleFilled from '@haiilo/catalyst-icons/tmp/assets/star-circle-filled.svg';\nimport log from 'loglevel';\n\nexport class CatIconRegistry {\n private static instance: CatIconRegistry;\n\n private readonly id = (Math.random() + 1).toString(36).substring(2);\n private readonly icons: Map<string, string> = new Map();\n\n private constructor() {\n // hide constructor\n\n // register default icons that are used in the framework by other components\n this.addIcons(\n {\n 'alert-primary': starCircleFilled,\n 'alert-secondary': clockFilled,\n 'alert-info': infoCircleFilled,\n 'alert-success': checkCircleFilled,\n 'alert-warning': dangerFilled,\n 'alert-danger': crossCircleFilled,\n 'dialog-close': crossOutlined,\n 'input-close': crossCircleOutlined,\n 'input-error': alertCircleOutlined,\n 'notification-close': crossCircleOutlined,\n 'pagination-left': chevronLeftOutlined,\n 'pagination-right': chevronRightOutlined,\n 'select-clear': cross16,\n 'select-open': chevronDownOutlined\n },\n '$cat',\n true\n );\n\n // In rare cases, the registry can be initialized twice. This can happen in\n // a micro frontend architecture where the registry is initialized in the\n // host application and in the micro frontend. To prevent the registry in\n // one application from overwriting the registry in the other, we listen for\n // events that are dispatched when icons are added or removed in other\n // applications and add or remove icons if the event was not dispatched by\n // this registry.\n window.addEventListener('cat-icons-added', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.addIcons(detail.icons, detail.setName, true);\n }\n });\n window.addEventListener('cat-icons-removed', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.removeIcons(detail.names, detail.setName, true);\n }\n });\n }\n\n static getInstance(): CatIconRegistry {\n if (!CatIconRegistry.instance) {\n CatIconRegistry.instance = new CatIconRegistry();\n }\n return CatIconRegistry.instance;\n }\n\n getIcon(name: string, setName?: string): string | undefined {\n const icon = this.icons.get(this.buildName(name, setName));\n if (!icon) {\n log.error(`[CatIconRegistry] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);\n }\n return icon;\n }\n\n addIcons(icons: { [name: string]: string }, setName?: string, silent = false): CatIconRegistry {\n const iconEntries = Object.entries(icons);\n const iconSize = iconEntries.length;\n iconEntries.forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));\n log.info(`[CatIconRegistry] Added ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` to set ${setName}` : ''}`);\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-added', { id: this.id, icons, setName }));\n return this;\n }\n\n removeIcons(names: string[], setName?: string, silent = false): CatIconRegistry {\n const iconSize = names.length;\n names.forEach(name => this.icons.delete(this.buildName(name, setName)));\n log.info(`[CatIconRegistry] Removed ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` from set ${setName}` : ''}`);\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-removed', { id: this.id, names, setName }));\n return this;\n }\n\n private buildName(name: string, setName?: string) {\n return setName ? `${setName}:${name}` : name;\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n\nexport const catIconRegistry = CatIconRegistry.getInstance();\n"]}
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
.cat-bg-primary {
|
|
27
27
|
background-color: rgb(var(--cat-primary-bg, 0, 129, 148)) !important;
|
|
28
28
|
color: rgb(var(--cat-primary-fill, 255, 255, 255)) !important;
|
|
29
|
+
--cat-primary-text: cat-token("color.theme.primary.fill", $wrap: false);
|
|
30
|
+
--cat-primary-text-hover: cat-token("color.theme.primary.fill-hover", $wrap: false);
|
|
31
|
+
--cat-primary-text-active: cat-token("color.theme.primary.fill-active", $wrap: false);
|
|
32
|
+
--cat-link-decoration: underline;
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
.cat-bg-primary-hover {
|
|
@@ -34,6 +38,10 @@
|
|
|
34
38
|
.cat-bg-primary-hover:hover {
|
|
35
39
|
background-color: rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;
|
|
36
40
|
color: rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important;
|
|
41
|
+
--cat-primary-text: cat-token("color.theme.primary.fill", $wrap: false);
|
|
42
|
+
--cat-primary-text-hover: cat-token("color.theme.primary.fill-hover", $wrap: false);
|
|
43
|
+
--cat-primary-text-active: cat-token("color.theme.primary.fill-active", $wrap: false);
|
|
44
|
+
--cat-link-decoration: underline;
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
.cat-text-primary,
|
|
@@ -57,6 +65,10 @@
|
|
|
57
65
|
.cat-bg-primaryInverted {
|
|
58
66
|
background-color: #93b4f2 !important;
|
|
59
67
|
color: black !important;
|
|
68
|
+
--cat-primary-text: cat-token("color.theme.primaryInverted.fill", $wrap: false);
|
|
69
|
+
--cat-primary-text-hover: cat-token("color.theme.primaryInverted.fill-hover", $wrap: false);
|
|
70
|
+
--cat-primary-text-active: cat-token("color.theme.primaryInverted.fill-active", $wrap: false);
|
|
71
|
+
--cat-link-decoration: underline;
|
|
60
72
|
}
|
|
61
73
|
|
|
62
74
|
.cat-bg-primaryInverted-hover {
|
|
@@ -65,6 +77,10 @@
|
|
|
65
77
|
.cat-bg-primaryInverted-hover:hover {
|
|
66
78
|
background-color: #93b4f2 !important;
|
|
67
79
|
color: black !important;
|
|
80
|
+
--cat-primary-text: cat-token("color.theme.primaryInverted.fill", $wrap: false);
|
|
81
|
+
--cat-primary-text-hover: cat-token("color.theme.primaryInverted.fill-hover", $wrap: false);
|
|
82
|
+
--cat-primary-text-active: cat-token("color.theme.primaryInverted.fill-active", $wrap: false);
|
|
83
|
+
--cat-link-decoration: underline;
|
|
68
84
|
}
|
|
69
85
|
|
|
70
86
|
.cat-text-primaryInverted,
|
|
@@ -88,6 +104,10 @@
|
|
|
88
104
|
.cat-bg-secondary {
|
|
89
105
|
background-color: rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;
|
|
90
106
|
color: rgb(var(--cat-secondary-fill, 255, 255, 255)) !important;
|
|
107
|
+
--cat-primary-text: cat-token("color.theme.secondary.fill", $wrap: false);
|
|
108
|
+
--cat-primary-text-hover: cat-token("color.theme.secondary.fill-hover", $wrap: false);
|
|
109
|
+
--cat-primary-text-active: cat-token("color.theme.secondary.fill-active", $wrap: false);
|
|
110
|
+
--cat-link-decoration: underline;
|
|
91
111
|
}
|
|
92
112
|
|
|
93
113
|
.cat-bg-secondary-hover {
|
|
@@ -96,6 +116,10 @@
|
|
|
96
116
|
.cat-bg-secondary-hover:hover {
|
|
97
117
|
background-color: rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;
|
|
98
118
|
color: rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important;
|
|
119
|
+
--cat-primary-text: cat-token("color.theme.secondary.fill", $wrap: false);
|
|
120
|
+
--cat-primary-text-hover: cat-token("color.theme.secondary.fill-hover", $wrap: false);
|
|
121
|
+
--cat-primary-text-active: cat-token("color.theme.secondary.fill-active", $wrap: false);
|
|
122
|
+
--cat-link-decoration: underline;
|
|
99
123
|
}
|
|
100
124
|
|
|
101
125
|
.cat-text-secondary,
|
|
@@ -119,6 +143,10 @@
|
|
|
119
143
|
.cat-bg-secondaryInverted {
|
|
120
144
|
background-color: #697687 !important;
|
|
121
145
|
color: black !important;
|
|
146
|
+
--cat-primary-text: cat-token("color.theme.secondaryInverted.fill", $wrap: false);
|
|
147
|
+
--cat-primary-text-hover: cat-token("color.theme.secondaryInverted.fill-hover", $wrap: false);
|
|
148
|
+
--cat-primary-text-active: cat-token("color.theme.secondaryInverted.fill-active", $wrap: false);
|
|
149
|
+
--cat-link-decoration: underline;
|
|
122
150
|
}
|
|
123
151
|
|
|
124
152
|
.cat-bg-secondaryInverted-hover {
|
|
@@ -127,6 +155,10 @@
|
|
|
127
155
|
.cat-bg-secondaryInverted-hover:hover {
|
|
128
156
|
background-color: #697687 !important;
|
|
129
157
|
color: black !important;
|
|
158
|
+
--cat-primary-text: cat-token("color.theme.secondaryInverted.fill", $wrap: false);
|
|
159
|
+
--cat-primary-text-hover: cat-token("color.theme.secondaryInverted.fill-hover", $wrap: false);
|
|
160
|
+
--cat-primary-text-active: cat-token("color.theme.secondaryInverted.fill-active", $wrap: false);
|
|
161
|
+
--cat-link-decoration: underline;
|
|
130
162
|
}
|
|
131
163
|
|
|
132
164
|
.cat-text-secondaryInverted,
|
|
@@ -147,9 +179,52 @@
|
|
|
147
179
|
color: white !important;
|
|
148
180
|
}
|
|
149
181
|
|
|
182
|
+
.cat-bg-info {
|
|
183
|
+
background-color: rgb(var(--cat-success-bg, 0, 115, 230)) !important;
|
|
184
|
+
color: rgb(var(--cat-success-fill, 255, 255, 255)) !important;
|
|
185
|
+
--cat-primary-text: cat-token("color.theme.info.fill", $wrap: false);
|
|
186
|
+
--cat-primary-text-hover: cat-token("color.theme.info.fill-hover", $wrap: false);
|
|
187
|
+
--cat-primary-text-active: cat-token("color.theme.info.fill-active", $wrap: false);
|
|
188
|
+
--cat-link-decoration: underline;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.cat-bg-info-hover {
|
|
192
|
+
transition: background-color 125ms, color 125ms;
|
|
193
|
+
}
|
|
194
|
+
.cat-bg-info-hover:hover {
|
|
195
|
+
background-color: rgb(var(--cat-success-bg-hover, 0, 107, 227)) !important;
|
|
196
|
+
color: rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;
|
|
197
|
+
--cat-primary-text: cat-token("color.theme.info.fill", $wrap: false);
|
|
198
|
+
--cat-primary-text-hover: cat-token("color.theme.info.fill-hover", $wrap: false);
|
|
199
|
+
--cat-primary-text-active: cat-token("color.theme.info.fill-active", $wrap: false);
|
|
200
|
+
--cat-link-decoration: underline;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.cat-text-info,
|
|
204
|
+
.cat-link-info {
|
|
205
|
+
color: rgb(var(--cat-success-text, 0, 115, 230)) !important;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.cat-link-info,
|
|
209
|
+
.cat-text-info-hover {
|
|
210
|
+
transition: color 125ms;
|
|
211
|
+
}
|
|
212
|
+
.cat-link-info:hover,
|
|
213
|
+
.cat-text-info-hover:hover {
|
|
214
|
+
color: rgb(var(--cat-success-text-hover, 0, 107, 227)) !important;
|
|
215
|
+
}
|
|
216
|
+
.cat-link-info:active,
|
|
217
|
+
.cat-text-info-hover:active {
|
|
218
|
+
color: rgb(var(--cat-success-text-active, 0, 96, 223)) !important;
|
|
219
|
+
}
|
|
220
|
+
|
|
150
221
|
.cat-bg-success {
|
|
151
222
|
background-color: rgb(var(--cat-success-bg, 0, 132, 88)) !important;
|
|
152
223
|
color: rgb(var(--cat-success-fill, 255, 255, 255)) !important;
|
|
224
|
+
--cat-primary-text: cat-token("color.theme.success.fill", $wrap: false);
|
|
225
|
+
--cat-primary-text-hover: cat-token("color.theme.success.fill-hover", $wrap: false);
|
|
226
|
+
--cat-primary-text-active: cat-token("color.theme.success.fill-active", $wrap: false);
|
|
227
|
+
--cat-link-decoration: underline;
|
|
153
228
|
}
|
|
154
229
|
|
|
155
230
|
.cat-bg-success-hover {
|
|
@@ -158,6 +233,10 @@
|
|
|
158
233
|
.cat-bg-success-hover:hover {
|
|
159
234
|
background-color: rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;
|
|
160
235
|
color: rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;
|
|
236
|
+
--cat-primary-text: cat-token("color.theme.success.fill", $wrap: false);
|
|
237
|
+
--cat-primary-text-hover: cat-token("color.theme.success.fill-hover", $wrap: false);
|
|
238
|
+
--cat-primary-text-active: cat-token("color.theme.success.fill-active", $wrap: false);
|
|
239
|
+
--cat-link-decoration: underline;
|
|
161
240
|
}
|
|
162
241
|
|
|
163
242
|
.cat-text-success,
|
|
@@ -181,6 +260,10 @@
|
|
|
181
260
|
.cat-bg-warning {
|
|
182
261
|
background-color: rgb(var(--cat-warning-bg, 255, 206, 128)) !important;
|
|
183
262
|
color: rgb(var(--cat-warning-fill, 0, 0, 0)) !important;
|
|
263
|
+
--cat-primary-text: cat-token("color.theme.warning.fill", $wrap: false);
|
|
264
|
+
--cat-primary-text-hover: cat-token("color.theme.warning.fill-hover", $wrap: false);
|
|
265
|
+
--cat-primary-text-active: cat-token("color.theme.warning.fill-active", $wrap: false);
|
|
266
|
+
--cat-link-decoration: underline;
|
|
184
267
|
}
|
|
185
268
|
|
|
186
269
|
.cat-bg-warning-hover {
|
|
@@ -189,6 +272,10 @@
|
|
|
189
272
|
.cat-bg-warning-hover:hover {
|
|
190
273
|
background-color: rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;
|
|
191
274
|
color: rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important;
|
|
275
|
+
--cat-primary-text: cat-token("color.theme.warning.fill", $wrap: false);
|
|
276
|
+
--cat-primary-text-hover: cat-token("color.theme.warning.fill-hover", $wrap: false);
|
|
277
|
+
--cat-primary-text-active: cat-token("color.theme.warning.fill-active", $wrap: false);
|
|
278
|
+
--cat-link-decoration: underline;
|
|
192
279
|
}
|
|
193
280
|
|
|
194
281
|
.cat-text-warning,
|
|
@@ -212,6 +299,10 @@
|
|
|
212
299
|
.cat-bg-danger {
|
|
213
300
|
background-color: rgb(var(--cat-danger-bg, 217, 52, 13)) !important;
|
|
214
301
|
color: rgb(var(--cat-danger-fill, 255, 255, 255)) !important;
|
|
302
|
+
--cat-primary-text: cat-token("color.theme.danger.fill", $wrap: false);
|
|
303
|
+
--cat-primary-text-hover: cat-token("color.theme.danger.fill-hover", $wrap: false);
|
|
304
|
+
--cat-primary-text-active: cat-token("color.theme.danger.fill-active", $wrap: false);
|
|
305
|
+
--cat-link-decoration: underline;
|
|
215
306
|
}
|
|
216
307
|
|
|
217
308
|
.cat-bg-danger-hover {
|
|
@@ -220,6 +311,10 @@
|
|
|
220
311
|
.cat-bg-danger-hover:hover {
|
|
221
312
|
background-color: rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;
|
|
222
313
|
color: rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important;
|
|
314
|
+
--cat-primary-text: cat-token("color.theme.danger.fill", $wrap: false);
|
|
315
|
+
--cat-primary-text-hover: cat-token("color.theme.danger.fill-hover", $wrap: false);
|
|
316
|
+
--cat-primary-text-active: cat-token("color.theme.danger.fill-active", $wrap: false);
|
|
317
|
+
--cat-link-decoration: underline;
|
|
223
318
|
}
|
|
224
319
|
|
|
225
320
|
.cat-text-danger,
|
|
@@ -244,10 +339,22 @@
|
|
|
244
339
|
color: rgb(var(--cat-primary-text, 0, 129, 148)) !important;
|
|
245
340
|
}
|
|
246
341
|
|
|
342
|
+
.cat-text-active {
|
|
343
|
+
color: rgb(var(--cat-primary-text, 0, 129, 148)) !important;
|
|
344
|
+
}
|
|
345
|
+
|
|
247
346
|
.cat-muted {
|
|
248
347
|
color: rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;
|
|
249
348
|
}
|
|
250
349
|
|
|
350
|
+
.cat-text-muted {
|
|
351
|
+
color: rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.cat-bg-muted {
|
|
355
|
+
background-color: #f2f4f7 !important;
|
|
356
|
+
}
|
|
357
|
+
|
|
251
358
|
.cat-text-reset {
|
|
252
359
|
color: inherit !important;
|
|
253
360
|
}
|