@haiilo/catalyst 5.2.3 → 5.4.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 +56 -39
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.cdn.js +1 -0
- package/dist/catalyst/index.esm.js +2 -2
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/p-34e0cbba.entry.js +10 -0
- package/dist/catalyst/p-34e0cbba.entry.js.map +1 -0
- package/dist/catalyst/{p-d1fb9d96.js → p-ce6a1db2.js} +1 -1
- package/dist/catalyst/p-ce6a1db2.js.map +1 -0
- package/dist/catalyst/p-cf32399c.js +2 -0
- package/dist/catalyst/p-cf32399c.js.map +1 -0
- package/dist/catalyst/scss/_snippets/_checkbox-hint.scss +20 -0
- package/dist/catalyst/scss/_snippets/_form-label.scss +2 -1
- package/dist/catalyst/scss/utils/_border.scss +14 -0
- package/dist/catalyst/scss/utils/_media.mixins.scss +0 -1
- package/dist/catalyst/scss/utils/_typography.mixins.scss +1 -0
- package/dist/cjs/{cat-alert_24.cjs.entry.js → cat-alert_27.cjs.entry.js} +3777 -192
- package/dist/cjs/cat-alert_27.cjs.entry.js.map +1 -0
- package/dist/cjs/{cat-icon-registry-671af264.js → cat-icon-registry-228164a1.js} +43 -2
- package/dist/cjs/cat-icon-registry-228164a1.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +3 -3
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/{index-01312a2e.js → index-4258b31e.js} +8 -1
- package/dist/{catalyst/p-d1fb9d96.js.map → cjs/index-4258b31e.js.map} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +5 -2
- package/dist/collection/components/cat-alert/cat-alert.js +5 -5
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.css +27 -9
- package/dist/collection/components/cat-button/cat-button.js +27 -25
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.css +15 -0
- package/dist/collection/components/cat-button-group/cat-button-group.js +51 -0
- package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -0
- package/dist/collection/components/cat-checkbox/cat-checkbox.css +24 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +8 -4
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.css +381 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +873 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -0
- package/dist/collection/components/cat-datepicker/datepicker-type.js +8 -0
- package/dist/collection/components/cat-datepicker/datepicker-type.js.map +1 -0
- package/dist/collection/components/cat-datepicker/dayjs.config.js +8 -0
- package/dist/collection/components/cat-datepicker/dayjs.config.js.map +1 -0
- package/dist/collection/components/cat-datepicker/vanillajs-datepicker.config.js +46 -0
- package/dist/collection/components/cat-datepicker/vanillajs-datepicker.config.js.map +1 -0
- package/dist/collection/components/cat-dropdown/cat-dropdown.css +1 -0
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +26 -7
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +29 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +29 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +392 -15
- package/dist/collection/components/cat-input/cat-input.js +8 -4
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-label/cat-label.js +19 -0
- package/dist/collection/components/cat-label/cat-label.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +28 -6
- package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.css +24 -1
- package/dist/collection/components/cat-radio/cat-radio.js +8 -4
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +7 -3
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.css +1 -4
- package/dist/collection/components/cat-select/cat-select.css +98 -11
- package/dist/collection/components/cat-select/cat-select.js +73 -23
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.css +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.css +17 -16
- package/dist/collection/components/cat-textarea/cat-textarea.js +8 -4
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-timepicker/cat-timepicker.css +5 -0
- package/dist/collection/components/cat-timepicker/cat-timepicker.js +668 -0
- package/dist/collection/components/cat-timepicker/cat-timepicker.js.map +1 -0
- package/dist/collection/components/cat-toggle/cat-toggle.css +24 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +8 -4
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.css +1 -8
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +22 -18
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/collection/index.cdn.js +1 -0
- package/dist/collection/scss/_snippets/_checkbox-hint.scss +20 -0
- package/dist/collection/scss/_snippets/_form-label.scss +2 -1
- package/dist/collection/scss/utils/_border.scss +14 -0
- package/dist/collection/scss/utils/_media.mixins.scss +0 -1
- package/dist/collection/scss/utils/_typography.mixins.scss +1 -0
- package/dist/components/cat-alert.js +5 -5
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-button-group.d.ts +11 -0
- package/dist/components/cat-button-group.js +46 -0
- package/dist/components/cat-button-group.js.map +1 -0
- package/dist/components/cat-button2.js +12 -10
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-checkbox2.js +2 -2
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-datepicker.d.ts +11 -0
- package/dist/components/cat-datepicker.js +3210 -0
- package/dist/components/cat-datepicker.js.map +1 -0
- package/dist/components/cat-dropdown2.js +640 -43
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +11 -2
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-icon-registry.js +42 -1
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-input.js +1 -226
- package/dist/components/cat-input.js.map +1 -1
- package/dist/components/cat-input2.js +230 -0
- package/dist/components/cat-input2.js.map +1 -0
- package/dist/components/cat-label.js +2 -0
- package/dist/components/cat-label.js.map +1 -1
- package/dist/components/cat-pagination.js +10 -5
- package/dist/components/cat-pagination.js.map +1 -1
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +2 -2
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable2.js +7 -5
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.js +2 -2
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select2.js +46 -17
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-skeleton2.js +1 -1
- package/dist/components/cat-skeleton2.js.map +1 -1
- package/dist/components/cat-textarea.js +3 -3
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-timepicker.d.ts +11 -0
- package/dist/components/cat-timepicker.js +258 -0
- package/dist/components/cat-timepicker.js.map +1 -0
- package/dist/components/cat-toggle.js +2 -2
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.js +24 -20
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/floating-ui.dom.esm.js +142 -56
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{cat-alert_24.entry.js → cat-alert_27.entry.js} +3775 -193
- package/dist/esm/cat-alert_27.entry.js.map +1 -0
- package/dist/esm/{cat-icon-registry-d6b80490.js → cat-icon-registry-4bd597f4.js} +43 -2
- package/dist/esm/cat-icon-registry-4bd597f4.js.map +1 -0
- package/dist/esm/catalyst.js +4 -4
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/{index-fc2f91a4.js → index-636ce8d6.js} +8 -1
- package/dist/esm/index-636ce8d6.js.map +1 -0
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +4 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/types/components/cat-button/cat-button.d.ts +4 -5
- package/dist/types/components/cat-button-group/cat-button-group.d.ts +11 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +1 -1
- package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +187 -0
- package/dist/types/components/cat-datepicker/datepicker-type.d.ts +7 -0
- package/dist/types/components/cat-datepicker/datepicker.d.ts +1 -0
- package/dist/types/components/cat-datepicker/dayjs.config.d.ts +3 -0
- package/dist/types/components/cat-datepicker/vanillajs-datepicker.config.d.ts +4 -0
- package/dist/types/components/cat-form-group/cat-form-group.d.ts +5 -0
- package/dist/types/components/cat-input/cat-input.d.ts +1 -1
- package/dist/types/components/cat-label/cat-label.d.ts +4 -0
- package/dist/types/components/cat-pagination/cat-pagination.d.ts +6 -0
- package/dist/types/components/cat-radio/cat-radio.d.ts +1 -1
- package/dist/types/components/cat-radio-group/cat-radio-group.d.ts +1 -1
- package/dist/types/components/cat-select/cat-select.d.ts +10 -1
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +1 -1
- package/dist/types/components/cat-timepicker/cat-timepicker.d.ts +158 -0
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +1 -1
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +2 -2
- package/dist/types/components.d.ts +585 -17
- package/package.json +22 -18
- package/dist/catalyst/p-ccfebe33.js +0 -2
- package/dist/catalyst/p-ccfebe33.js.map +0 -1
- package/dist/catalyst/p-d135d677.entry.js +0 -10
- package/dist/catalyst/p-d135d677.entry.js.map +0 -1
- package/dist/cjs/cat-alert_24.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-671af264.js.map +0 -1
- package/dist/cjs/index-01312a2e.js.map +0 -1
- package/dist/components/first-tabbable.js +0 -464
- package/dist/components/first-tabbable.js.map +0 -1
- package/dist/esm/cat-alert_24.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-d6b80490.js.map +0 -1
- package/dist/esm/index-fc2f91a4.js.map +0 -1
|
@@ -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;mBAKyB,UAAU;iBAKgB,WAAW;kBAKtE,KAAK;gBAKwB,GAAG;;;oBAoB9B,KAAK;mBAON,KAAK;kBAKN,KAAK;sBAKD,KAAK;iBAKV,KAAK;;;;;oBA0BoB,KAAK;qBAK1B,KAAK;;;;;;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AAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,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' = '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 * The SVG source of an icon to be displayed in the button. This takes\n * precenedence over the `icon` name.\n */\n @Prop() iconSrc?: 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 @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 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 }}\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) || Boolean(this.iconSrc)) && this._iconOnly;\n }\n\n private get hasPrefixIcon() {\n return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && !this.iconRight;\n }\n\n private get hasSuffixIcon() {\n return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && this.iconRight;\n }\n\n private get content() {\n return [\n this.hasPrefixIcon ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} size={this.iconSize} part=\"prefix\"></cat-icon>\n ) : null,\n this.isIconButton ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} size={this.iconSize}></cat-icon>\n ) : (\n <span class=\"cat-button-content\" part=\"content\">\n <slot></slot>\n </span>\n ),\n this.hasSuffixIcon ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} size={this.iconSize} part=\"suffix\"></cat-icon>\n ) : 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,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AAC;EACJ,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,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' = '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 * 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 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\">\n <slot></slot>\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"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
vertical-align: middle;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
::slotted(cat-button[variant=outlined]),
|
|
8
|
+
::slotted(cat-button:not([variant])) {
|
|
9
|
+
margin-right: -1px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
::slotted(cat-button[variant=outlined]:last-child),
|
|
13
|
+
::slotted(cat-button:not([variant]):last-child) {
|
|
14
|
+
margin-right: 0;
|
|
15
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
|
+
export class CatButtonGroup {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.formElements = [];
|
|
5
|
+
this.a11yLabel = undefined;
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
return (h(Host, { role: "group", "aria-label": this.a11yLabel }, h("slot", { onSlotchange: this.onSlotChange.bind(this) })));
|
|
9
|
+
}
|
|
10
|
+
onSlotChange() {
|
|
11
|
+
this.formElements = Array.from(this.hostElement.querySelectorAll('cat-button'));
|
|
12
|
+
this.formElements.forEach((element, index) => {
|
|
13
|
+
element.buttonGroupPosition = index === 0 ? 'first' : index === this.formElements.length - 1 ? 'last' : 'middle';
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
static get is() { return "cat-button-group"; }
|
|
17
|
+
static get encapsulation() { return "shadow"; }
|
|
18
|
+
static get originalStyleUrls() {
|
|
19
|
+
return {
|
|
20
|
+
"$": ["cat-button-group.scss"]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static get styleUrls() {
|
|
24
|
+
return {
|
|
25
|
+
"$": ["cat-button-group.css"]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static get properties() {
|
|
29
|
+
return {
|
|
30
|
+
"a11yLabel": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"mutable": false,
|
|
33
|
+
"complexType": {
|
|
34
|
+
"original": "string",
|
|
35
|
+
"resolved": "string | undefined",
|
|
36
|
+
"references": {}
|
|
37
|
+
},
|
|
38
|
+
"required": false,
|
|
39
|
+
"optional": true,
|
|
40
|
+
"docs": {
|
|
41
|
+
"tags": [],
|
|
42
|
+
"text": "Adds an accessible label for the button group that\nit is only shown in assistive technologies, like screen readers."
|
|
43
|
+
},
|
|
44
|
+
"attribute": "a11y-label",
|
|
45
|
+
"reflect": false
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
static get elementRef() { return "hostElement"; }
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=cat-button-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cat-button-group.js","sourceRoot":"","sources":["../../../src/components/cat-button-group/cat-button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOlE,MAAM,OAAO,cAAc;;IACjB,iBAAY,GAA2B,EAAE,CAAC;;;EAUlD,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,IAAC,IAAI,EAAC,OAAO,gBAAa,IAAI,CAAC,SAAS;MAC3C,YAAM,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS,CACpD,CACR,CAAC;EACJ,CAAC;EAEO,YAAY;IAClB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;IAEhF,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;MAC3C,OAAO,CAAC,mBAAmB,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACnH,CAAC,CAAC,CAAC;EACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'cat-button-group',\n styleUrl: 'cat-button-group.scss',\n shadow: true\n})\nexport class CatButtonGroup {\n private formElements: HTMLCatButtonElement[] = [];\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * Adds an accessible label for the button group that\n * it is only shown in assistive technologies, like screen readers.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n render() {\n return (\n <Host role=\"group\" aria-label={this.a11yLabel}>\n <slot onSlotchange={this.onSlotChange.bind(this)}></slot>\n </Host>\n );\n }\n\n private onSlotChange(): void {\n this.formElements = Array.from(this.hostElement.querySelectorAll('cat-button'));\n\n this.formElements.forEach((element, index) => {\n element.buttonGroupPosition = index === 0 ? 'first' : index === this.formElements.length - 1 ? 'last' : 'middle';\n });\n }\n}\n"]}
|
|
@@ -12,11 +12,30 @@
|
|
|
12
12
|
.hint-section .input-hint,
|
|
13
13
|
.hint-section ::slotted([slot=hint]) {
|
|
14
14
|
font-size: 0.875rem;
|
|
15
|
-
line-height:
|
|
15
|
+
line-height: 1.125rem;
|
|
16
16
|
font-weight: var(--cat-font-weight-body, 400);
|
|
17
17
|
margin: 0 !important;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
.hint-wrapper {
|
|
21
|
+
flex: 0 1 auto;
|
|
22
|
+
display: flex;
|
|
23
|
+
gap: 0.5rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.hint-section {
|
|
27
|
+
flex: 1 1 auto;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.input-hint,
|
|
32
|
+
::slotted([slot=hint]) {
|
|
33
|
+
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
34
|
+
line-height: 1.5;
|
|
35
|
+
flex: 1 1 auto;
|
|
36
|
+
min-width: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
20
39
|
:host {
|
|
21
40
|
display: flex;
|
|
22
41
|
flex-direction: column;
|
|
@@ -63,6 +82,10 @@ input {
|
|
|
63
82
|
top: 0.5px;
|
|
64
83
|
}
|
|
65
84
|
|
|
85
|
+
.box-placeholder {
|
|
86
|
+
width: calc(1.25rem + 1px);
|
|
87
|
+
}
|
|
88
|
+
|
|
66
89
|
.box {
|
|
67
90
|
flex: 0 0 auto;
|
|
68
91
|
display: flex;
|
|
@@ -68,7 +68,7 @@ export class CatCheckbox {
|
|
|
68
68
|
this.input.click();
|
|
69
69
|
}
|
|
70
70
|
render() {
|
|
71
|
-
return (h(Host, null, h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })), h("span", { class: "box", "aria-hidden": "true", part: "checkbox" }, h("svg", { class: "check", viewBox: "0 0 12 10" }, h("polyline", { points: "1.5 6 4.5 9 10.5 1" })), h("svg", { class: "dash", viewBox: "0 0 12 10" }, h("polyline", { points: "1.5 5 10.5 5" }))), h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), (this.hint || this.hasSlottedHint) && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) }))));
|
|
71
|
+
return (h(Host, null, h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })), h("span", { class: "box", "aria-hidden": "true", part: "checkbox" }, h("svg", { class: "check", viewBox: "0 0 12 10" }, h("polyline", { points: "1.5 6 4.5 9 10.5 1" })), h("svg", { class: "dash", viewBox: "0 0 12 10" }, h("polyline", { points: "1.5 5 10.5 5" }))), h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), (this.hint || this.hasSlottedHint) && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "box-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
|
|
72
72
|
}
|
|
73
73
|
onInput(event) {
|
|
74
74
|
this.checked = this.input.checked;
|
|
@@ -326,9 +326,13 @@ export class CatCheckbox {
|
|
|
326
326
|
"text": "Emitted when the checked status of the checkbox is changed."
|
|
327
327
|
},
|
|
328
328
|
"complexType": {
|
|
329
|
-
"original": "
|
|
330
|
-
"resolved": "
|
|
331
|
-
"references": {
|
|
329
|
+
"original": "InputEvent",
|
|
330
|
+
"resolved": "InputEvent",
|
|
331
|
+
"references": {
|
|
332
|
+
"InputEvent": {
|
|
333
|
+
"location": "global"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
332
336
|
}
|
|
333
337
|
}, {
|
|
334
338
|
"method": "catFocus",
|
|
@@ -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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3B;IACD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC7B,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 * 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 * Indeterminate state of the checkbox\n */\n @Prop() indeterminate = false;\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 checkbox\n */\n @Prop({ mutable: true }) value?: string | boolean;\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 @Event() catChange!: EventEmitter<InputEvent>;\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 componentDidLoad() {\n if (this.input && this.indeterminate) {\n this.input.indeterminate = true;\n }\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 /**\n * Programmatically simulate a click on the checkbox.\n */\n @Method()\n async doClick(): Promise<void> {\n this.input.click();\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 !== undefined ? String(this.value) : this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\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.hint || this.hasSlottedHint) && (\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 onInput(event: InputEvent) {\n this.checked = this.input.checked;\n\n if (!this.value || typeof this.value === 'boolean') {\n this.value = this.checked;\n }\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"]}
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated file. Do not edit directly.
|
|
3
|
+
*/
|
|
4
|
+
/* stylelint-disable value-keyword-case */
|
|
5
|
+
/* stylelint-enable value-keyword-case */
|
|
6
|
+
.datepicker {
|
|
7
|
+
width: min-content;
|
|
8
|
+
}
|
|
9
|
+
.datepicker:not(.active) {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.datepicker-dropdown {
|
|
14
|
+
position: absolute;
|
|
15
|
+
z-index: 20;
|
|
16
|
+
padding-top: 4px;
|
|
17
|
+
}
|
|
18
|
+
.datepicker-dropdown.datepicker-orient-top {
|
|
19
|
+
padding-top: 0;
|
|
20
|
+
padding-bottom: 4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.datepicker-picker {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
border-radius: var(--cat-border-radius-m, 0.25rem);
|
|
27
|
+
background-color: white;
|
|
28
|
+
}
|
|
29
|
+
.datepicker-dropdown .datepicker-picker {
|
|
30
|
+
box-shadow: 0 4px 6px -2px rgba(27, 31, 38, 0.03), 0 12px 16px -4px rgba(27, 31, 38, 0.08);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.datepicker-main {
|
|
34
|
+
flex: auto;
|
|
35
|
+
padding: 2px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.datepicker-footer {
|
|
39
|
+
box-shadow: none;
|
|
40
|
+
background-color: transparent;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.datepicker-title {
|
|
44
|
+
box-shadow: none;
|
|
45
|
+
background-color: hsl(0, 0%, 96%);
|
|
46
|
+
padding: 0.375rem 0.75rem;
|
|
47
|
+
text-align: center;
|
|
48
|
+
font-weight: 700;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.datepicker-controls {
|
|
52
|
+
display: flex;
|
|
53
|
+
}
|
|
54
|
+
.datepicker-header .datepicker-controls {
|
|
55
|
+
padding: 2px 2px 0;
|
|
56
|
+
}
|
|
57
|
+
.datepicker-controls .button {
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
position: relative;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
margin: 0;
|
|
63
|
+
border: 1px solid rgb(var(--cat-border-color, 235, 236, 240));
|
|
64
|
+
border-radius: var(--cat-border-radius-m, 0.25rem);
|
|
65
|
+
box-shadow: none;
|
|
66
|
+
background-color: hsl(0, 0%, 100%);
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
padding: calc(0.375em - 1px) 0.75em;
|
|
69
|
+
height: 2.25em;
|
|
70
|
+
vertical-align: top;
|
|
71
|
+
text-align: center;
|
|
72
|
+
line-height: 1.5;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
color: hsl(0, 0%, 21%);
|
|
75
|
+
font-size: 0.9375rem;
|
|
76
|
+
}
|
|
77
|
+
.datepicker-controls .button:focus, .datepicker-controls .button:active {
|
|
78
|
+
outline: none;
|
|
79
|
+
}
|
|
80
|
+
.datepicker-controls .button:hover {
|
|
81
|
+
border-color: #b8b8b8;
|
|
82
|
+
color: hsl(0, 0%, 21%);
|
|
83
|
+
}
|
|
84
|
+
.datepicker-controls .button:focus {
|
|
85
|
+
border-color: hsl(217, 71%, 53%);
|
|
86
|
+
color: hsl(0, 0%, 21%);
|
|
87
|
+
}
|
|
88
|
+
.datepicker-controls .button:focus:not(:active) {
|
|
89
|
+
box-shadow: 0 0 0 0.125em rgba(50, 115, 220, 0.25);
|
|
90
|
+
}
|
|
91
|
+
.datepicker-controls .button:active {
|
|
92
|
+
border-color: #474747;
|
|
93
|
+
color: hsl(0, 0%, 21%);
|
|
94
|
+
}
|
|
95
|
+
.datepicker-controls .button[disabled] {
|
|
96
|
+
cursor: not-allowed;
|
|
97
|
+
}
|
|
98
|
+
.datepicker-header .datepicker-controls .button {
|
|
99
|
+
border-color: transparent;
|
|
100
|
+
font-weight: bold;
|
|
101
|
+
}
|
|
102
|
+
.datepicker-header .datepicker-controls .button:hover {
|
|
103
|
+
background-color: #f2f4f7;
|
|
104
|
+
}
|
|
105
|
+
.datepicker-header .datepicker-controls .button:active {
|
|
106
|
+
background-color: #f2f4f7;
|
|
107
|
+
}
|
|
108
|
+
.datepicker-footer .datepicker-controls .button {
|
|
109
|
+
flex: auto;
|
|
110
|
+
margin: calc(0.375rem - 1px) 0.375rem;
|
|
111
|
+
border-radius: var(--cat-border-radius-s, 0.125rem);
|
|
112
|
+
font-size: 0.875rem;
|
|
113
|
+
}
|
|
114
|
+
.datepicker-controls .view-switch {
|
|
115
|
+
flex: auto;
|
|
116
|
+
}
|
|
117
|
+
.datepicker-controls .prev-button,
|
|
118
|
+
.datepicker-controls .next-button {
|
|
119
|
+
padding-right: 0.375rem;
|
|
120
|
+
padding-left: 0.375rem;
|
|
121
|
+
flex: 0 0 14.2857142857%;
|
|
122
|
+
}
|
|
123
|
+
.datepicker-controls .prev-button.disabled,
|
|
124
|
+
.datepicker-controls .next-button.disabled {
|
|
125
|
+
visibility: hidden;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.datepicker-view,
|
|
129
|
+
.datepicker-grid {
|
|
130
|
+
display: flex;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.datepicker-view {
|
|
134
|
+
align-items: stretch;
|
|
135
|
+
width: 17.5rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.datepicker-grid {
|
|
139
|
+
flex-wrap: wrap;
|
|
140
|
+
flex: auto;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.datepicker .days {
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
flex: auto;
|
|
147
|
+
}
|
|
148
|
+
.datepicker .days-of-week {
|
|
149
|
+
display: flex;
|
|
150
|
+
}
|
|
151
|
+
.datepicker .week-numbers {
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-direction: column;
|
|
154
|
+
flex: 0 0 9.6774193548%;
|
|
155
|
+
}
|
|
156
|
+
.datepicker .weeks {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
align-items: stretch;
|
|
160
|
+
flex: auto;
|
|
161
|
+
}
|
|
162
|
+
.datepicker span {
|
|
163
|
+
display: flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
justify-content: center;
|
|
166
|
+
border-radius: var(--cat-border-radius-m, 0.25rem);
|
|
167
|
+
cursor: default;
|
|
168
|
+
-webkit-touch-callout: none;
|
|
169
|
+
user-select: none;
|
|
170
|
+
}
|
|
171
|
+
.datepicker .dow {
|
|
172
|
+
height: 2rem;
|
|
173
|
+
font-size: 0.875rem0.9375rem/2;
|
|
174
|
+
font-weight: 700;
|
|
175
|
+
}
|
|
176
|
+
.datepicker .week {
|
|
177
|
+
flex: auto;
|
|
178
|
+
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
179
|
+
font-size: 0.875rem;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.datepicker-cell, .datepicker .days .dow {
|
|
183
|
+
flex-basis: 14.2857142857%;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.datepicker-cell {
|
|
187
|
+
height: 2.5rem;
|
|
188
|
+
}
|
|
189
|
+
.datepicker-cell:not(.day) {
|
|
190
|
+
flex-basis: 25%;
|
|
191
|
+
height: 5rem;
|
|
192
|
+
}
|
|
193
|
+
.datepicker-cell:not(.disabled):hover {
|
|
194
|
+
background-color: transparent;
|
|
195
|
+
cursor: pointer;
|
|
196
|
+
}
|
|
197
|
+
.datepicker-cell.focused:not(.selected) {
|
|
198
|
+
background-color: #f2f4f7;
|
|
199
|
+
}
|
|
200
|
+
.datepicker-cell.selected, .datepicker-cell.selected:hover {
|
|
201
|
+
background-color: rgb(var(--cat-primary-bg, 0, 129, 148));
|
|
202
|
+
color: rgb(var(--cat-primary-fill, 255, 255, 255));
|
|
203
|
+
font-weight: 700;
|
|
204
|
+
}
|
|
205
|
+
.datepicker-cell.disabled {
|
|
206
|
+
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
207
|
+
}
|
|
208
|
+
.datepicker-cell.prev:not(.disabled), .datepicker-cell.next:not(.disabled) {
|
|
209
|
+
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
210
|
+
}
|
|
211
|
+
.datepicker-cell.prev.selected, .datepicker-cell.next.selected {
|
|
212
|
+
color: rgb(var(--cat-primary-fill, 255, 255, 255));
|
|
213
|
+
}
|
|
214
|
+
.datepicker-cell.highlighted:not(.selected):not(.range):not(.today) {
|
|
215
|
+
border-radius: 0;
|
|
216
|
+
background-color: #f2f4f7;
|
|
217
|
+
}
|
|
218
|
+
.datepicker-cell.highlighted:not(.selected):not(.range):not(.today):not(.disabled):hover {
|
|
219
|
+
background-color: #f2f4f7;
|
|
220
|
+
}
|
|
221
|
+
.datepicker-cell.highlighted:not(.selected):not(.range):not(.today).focused {
|
|
222
|
+
background-color: #f2f4f7;
|
|
223
|
+
}
|
|
224
|
+
.datepicker-cell.today:not(.selected) {
|
|
225
|
+
background-color: transparent;
|
|
226
|
+
}
|
|
227
|
+
.datepicker-cell.today:not(.selected):not(.disabled) {
|
|
228
|
+
color: rgb(var(--cat-primary-text, 0, 129, 148));
|
|
229
|
+
}
|
|
230
|
+
.datepicker-cell.today.focused:not(.selected) {
|
|
231
|
+
background-color: #f2f4f7;
|
|
232
|
+
}
|
|
233
|
+
.datepicker-cell.range-end:not(.selected), .datepicker-cell.range-start:not(.selected) {
|
|
234
|
+
background-color: #b8b8b8;
|
|
235
|
+
color: rgb(var(--cat-primary-fill, 255, 255, 255));
|
|
236
|
+
}
|
|
237
|
+
.datepicker-cell.range-end.focused:not(.selected), .datepicker-cell.range-start.focused:not(.selected) {
|
|
238
|
+
background-color: #b3b3b3;
|
|
239
|
+
}
|
|
240
|
+
.datepicker-cell.range-start:not(.range-end) {
|
|
241
|
+
border-radius: var(--cat-border-radius-m, 0.25rem) 0 0 var(--cat-border-radius-m, 0.25rem);
|
|
242
|
+
}
|
|
243
|
+
.datepicker-cell.range-end:not(.range-start) {
|
|
244
|
+
border-radius: 0 var(--cat-border-radius-m, 0.25rem) var(--cat-border-radius-m, 0.25rem) 0;
|
|
245
|
+
}
|
|
246
|
+
.datepicker-cell.range {
|
|
247
|
+
border-radius: 0;
|
|
248
|
+
background-color: gainsboro;
|
|
249
|
+
}
|
|
250
|
+
.datepicker-cell.range:not(.disabled):not(.focused):not(.today):hover {
|
|
251
|
+
background-color: #d7d7d7;
|
|
252
|
+
}
|
|
253
|
+
.datepicker-cell.range.disabled {
|
|
254
|
+
color: #c6c6c6;
|
|
255
|
+
}
|
|
256
|
+
.datepicker-cell.range.focused {
|
|
257
|
+
background-color: #d1d1d1;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.datepicker-input.in-edit {
|
|
261
|
+
border-color: #276bda;
|
|
262
|
+
}
|
|
263
|
+
.datepicker-input.in-edit:focus, .datepicker-input.in-edit:active {
|
|
264
|
+
box-shadow: none;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.datepicker-picker {
|
|
268
|
+
border: 1px solid rgb(var(--cat-border-color, 235, 236, 240));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.datepicker-main {
|
|
272
|
+
padding: 0.5rem 1rem;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.datepicker-view:has(.week-numbers) {
|
|
276
|
+
width: 19.375rem;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.datepicker-view.months,
|
|
280
|
+
.datepicker-view.years {
|
|
281
|
+
width: 20rem;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.datepicker .dow,
|
|
285
|
+
.datepicker .week {
|
|
286
|
+
font-size: 0.75rem;
|
|
287
|
+
line-height: 1rem;
|
|
288
|
+
font-weight: 700;
|
|
289
|
+
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.datepicker-cell.today:not(.selected) {
|
|
293
|
+
box-shadow: inset 0 0 0 2px rgb(var(--cat-primary-bg, 0, 129, 148));
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.datepicker-cell.focused:not(.selected),
|
|
297
|
+
.datepicker-cell:not(.selected):not(.disabled):hover {
|
|
298
|
+
background-color: #f2f4f7;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.datepicker-controls {
|
|
302
|
+
gap: 0.5rem;
|
|
303
|
+
}
|
|
304
|
+
.datepicker-header .datepicker-controls {
|
|
305
|
+
padding: 1rem 1rem 0;
|
|
306
|
+
}
|
|
307
|
+
.datepicker-header .datepicker-controls .button {
|
|
308
|
+
height: 2.5rem;
|
|
309
|
+
}
|
|
310
|
+
.datepicker-header .datepicker-controls .prev-button,
|
|
311
|
+
.datepicker-header .datepicker-controls .next-button {
|
|
312
|
+
flex-basis: 2.5rem;
|
|
313
|
+
font-size: 1.25rem;
|
|
314
|
+
}
|
|
315
|
+
.datepicker-footer .datepicker-controls {
|
|
316
|
+
padding: 0 1rem 1rem;
|
|
317
|
+
}
|
|
318
|
+
.datepicker-footer .datepicker-controls .button {
|
|
319
|
+
margin: 0;
|
|
320
|
+
height: 2.5rem;
|
|
321
|
+
font-size: 0.9375rem;
|
|
322
|
+
}
|
|
323
|
+
.datepicker-footer .datepicker-controls .button:hover, .datepicker-footer .datepicker-controls .button:active {
|
|
324
|
+
border-color: rgb(var(--cat-border-color-dark, 215, 219, 224));
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1)::before {
|
|
328
|
+
content: "";
|
|
329
|
+
width: 700%;
|
|
330
|
+
height: 100%;
|
|
331
|
+
border-radius: var(--cat-border-radius-m, 0.25rem);
|
|
332
|
+
position: absolute;
|
|
333
|
+
top: 0;
|
|
334
|
+
left: 0;
|
|
335
|
+
opacity: 0;
|
|
336
|
+
z-index: 1;
|
|
337
|
+
}
|
|
338
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).today:not(.selected)::before {
|
|
339
|
+
box-shadow: inset 0 0 0 1.5px #008194;
|
|
340
|
+
border-radius: var(--cat-border-radius-m, 0.25rem);
|
|
341
|
+
opacity: 1;
|
|
342
|
+
}
|
|
343
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1):not(:hover)::before {
|
|
344
|
+
background: none;
|
|
345
|
+
}
|
|
346
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1):hover::before {
|
|
347
|
+
opacity: 1;
|
|
348
|
+
background-color: transparent;
|
|
349
|
+
}
|
|
350
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).selected, .datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).selected.focused {
|
|
351
|
+
color: white;
|
|
352
|
+
}
|
|
353
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).selected::before, .datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).selected.focused::before {
|
|
354
|
+
opacity: 1;
|
|
355
|
+
background-color: rgb(var(--cat-primary-bg, 0, 129, 148));
|
|
356
|
+
z-index: -1;
|
|
357
|
+
}
|
|
358
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).focused {
|
|
359
|
+
background: none;
|
|
360
|
+
}
|
|
361
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).focused::before {
|
|
362
|
+
opacity: 1;
|
|
363
|
+
background-color: #f2f4f7;
|
|
364
|
+
z-index: -1;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell {
|
|
368
|
+
position: relative;
|
|
369
|
+
}
|
|
370
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell.selected, .datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell.focused {
|
|
371
|
+
z-index: 2;
|
|
372
|
+
}
|
|
373
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell.today:not(.selected) {
|
|
374
|
+
box-shadow: none;
|
|
375
|
+
}
|
|
376
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell:not(.disabled):hover {
|
|
377
|
+
background-color: inherit;
|
|
378
|
+
}
|
|
379
|
+
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell.focused {
|
|
380
|
+
background: none;
|
|
381
|
+
}
|