origam 2.37.17 → 2.37.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1160,6 +1160,8 @@
1160
1160
  --origam-field---border-opacity-outlined: 0.38;
1161
1161
  --origam-field---background-color: rgba(0, 0, 0, 0);
1162
1162
  --origam-field---color: var(--origam-color__text---primary);
1163
+ --origam-field---placeholder-color: currentColor;
1164
+ --origam-field---placeholder-opacity: 0.5;
1163
1165
  --origam-field---backdrop-filter: none;
1164
1166
  --origam-field---opacity-disabled: var(--origam-opacity---50);
1165
1167
  --origam-field---transition-duration: var(--origam-motion__duration---normal);
@@ -4184,6 +4186,8 @@
4184
4186
  --origam-field---border-opacity-outlined: 0.38;
4185
4187
  --origam-field---background-color: rgba(0, 0, 0, 0);
4186
4188
  --origam-field---color: var(--origam-color__text---primary);
4189
+ --origam-field---placeholder-color: currentColor;
4190
+ --origam-field---placeholder-opacity: 0.5;
4187
4191
  --origam-field---backdrop-filter: none;
4188
4192
  --origam-field---opacity-disabled: var(--origam-opacity---50);
4189
4193
  --origam-field---transition-duration: var(--origam-motion__duration---normal);
@@ -1060,6 +1060,8 @@
1060
1060
  --origam-field---border-opacity-outlined: 0.38;
1061
1061
  --origam-field---background-color: rgba(0, 0, 0, 0);
1062
1062
  --origam-field---color: var(--origam-color__text---primary);
1063
+ --origam-field---placeholder-color: currentColor;
1064
+ --origam-field---placeholder-opacity: 0.5;
1063
1065
  --origam-field---backdrop-filter: none;
1064
1066
  --origam-field---opacity-disabled: var(--origam-opacity---50);
1065
1067
  --origam-field---transition-duration: var(--origam-motion__duration---normal);
@@ -1160,6 +1160,8 @@
1160
1160
  --origam-field---border-opacity-outlined: 0.38;
1161
1161
  --origam-field---background-color: rgba(0, 0, 0, 0);
1162
1162
  --origam-field---color: var(--origam-color__text---primary);
1163
+ --origam-field---placeholder-color: currentColor;
1164
+ --origam-field---placeholder-opacity: 0.5;
1163
1165
  --origam-field---backdrop-filter: none;
1164
1166
  --origam-field---opacity-disabled: var(--origam-opacity---50);
1165
1167
  --origam-field---transition-duration: var(--origam-motion__duration---normal);
@@ -4184,6 +4186,8 @@
4184
4186
  --origam-field---border-opacity-outlined: 0.38;
4185
4187
  --origam-field---background-color: rgba(0, 0, 0, 0);
4186
4188
  --origam-field---color: var(--origam-color__text---primary);
4189
+ --origam-field---placeholder-color: currentColor;
4190
+ --origam-field---placeholder-opacity: 0.5;
4187
4191
  --origam-field---backdrop-filter: none;
4188
4192
  --origam-field---opacity-disabled: var(--origam-opacity---50);
4189
4193
  --origam-field---transition-duration: var(--origam-motion__duration---normal);
@@ -1060,6 +1060,8 @@
1060
1060
  --origam-field---border-opacity-outlined: 0.38;
1061
1061
  --origam-field---background-color: rgba(0, 0, 0, 0);
1062
1062
  --origam-field---color: var(--origam-color__text---primary);
1063
+ --origam-field---placeholder-color: currentColor;
1064
+ --origam-field---placeholder-opacity: 0.5;
1063
1065
  --origam-field---backdrop-filter: none;
1064
1066
  --origam-field---opacity-disabled: var(--origam-opacity---50);
1065
1067
  --origam-field---transition-duration: var(--origam-motion__duration---normal);
@@ -707,7 +707,7 @@ defineExpose({
707
707
  outline: none;
708
708
 
709
709
  &::placeholder {
710
- opacity: 0.5;
710
+ opacity: var(--origam-field---placeholder-opacity, 0.5);
711
711
  }
712
712
  }
713
713
 
@@ -721,8 +721,8 @@ defineExpose({
721
721
  border: none;
722
722
 
723
723
  &::placeholder {
724
- color: currentColor;
725
- opacity: 0.5;
724
+ color: var(--origam-field---placeholder-color, currentColor);
725
+ opacity: var(--origam-field---placeholder-opacity, 0.5);
726
726
  }
727
727
 
728
728
  &:focus,
@@ -74,8 +74,9 @@ import { useProps } from "../../composables/Commons/props.composable";
74
74
  import { useStyle } from "../../composables/Commons/style.composable";
75
75
  import { useTypography } from "../../composables/Commons/typography.composable";
76
76
  import vContrast from "../../directives/Contrast/contrast.directive";
77
+ import { intentBgExpr, intentFgExpr, isIntent } from "../../utils/Commons/color.util";
77
78
  import { getUid } from "../../utils/Commons/getCurrentInstance.util";
78
- import { ORIGAM_TABS_KEY, ORIGAM_TAB_PANELS_LINK_KEY } from "../../consts/Tabs/tabs.const";
79
+ import { ORIGAM_TABS_COLOR_KEY, ORIGAM_TABS_KEY, ORIGAM_TAB_PANELS_LINK_KEY } from "../../consts/Tabs/tabs.const";
79
80
  const props = defineProps({
80
81
  tag: { type: String, required: false, default: "button" },
81
82
  text: { type: String, required: false, default: "" },
@@ -87,6 +88,7 @@ const props = defineProps({
87
88
  value: { type: null, required: false, default: void 0 },
88
89
  disabled: { type: Boolean, required: false },
89
90
  selectedClass: { type: String, required: false },
91
+ color: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
90
92
  fontSize: { type: null, required: false },
91
93
  fontWeight: { type: null, required: false },
92
94
  letterSpacing: { type: null, required: false },
@@ -144,9 +146,19 @@ const handleClick = (event) => {
144
146
  };
145
147
  const hasIndicator = computed(() => props.variant === "underline");
146
148
  const { typographyStyles } = useTypography(props, "tabs__item");
149
+ const tabsColor = inject(ORIGAM_TABS_COLOR_KEY, void 0);
150
+ const pillsIntent = computed(() => {
151
+ const color = props.color || tabsColor?.value;
152
+ return typeof color === "string" && isIntent(color) ? color : void 0;
153
+ });
154
+ const pillsColorStyles = computed(() => pillsIntent.value ? {
155
+ "--origam-tabs__item--pills--active---background-color": intentBgExpr(pillsIntent.value, "default"),
156
+ "--origam-tabs__item--pills--active---color": intentFgExpr(pillsIntent.value, "default")
157
+ } : void 0);
147
158
  const tabStyles = computed(() => {
148
159
  return [
149
160
  typographyStyles.value,
161
+ pillsColorStyles.value,
150
162
  props.style
151
163
  ];
152
164
  });
@@ -29,7 +29,7 @@ import { usePassedProps } from "../../composables/Commons/passedProps.composable
29
29
  import { useProps } from "../../composables/Commons/props.composable";
30
30
  import { useRounded } from "../../composables/Commons/rounded.composable";
31
31
  import { useStyle } from "../../composables/Commons/style.composable";
32
- import { ORIGAM_TABS_KEY, ORIGAM_TAB_PANELS_KEY, ORIGAM_TAB_PANELS_LINK_KEY } from "../../consts/Tabs/tabs.const";
32
+ import { ORIGAM_TABS_COLOR_KEY, ORIGAM_TABS_KEY, ORIGAM_TAB_PANELS_KEY, ORIGAM_TAB_PANELS_LINK_KEY } from "../../consts/Tabs/tabs.const";
33
33
  import { omitUndefined } from "../../utils/Commons/commons.util";
34
34
  import { DENSITY } from "../../enums/Commons/density.enum";
35
35
  import { DIRECTION } from "../../enums/Commons/direction.enum";
@@ -86,6 +86,7 @@ const slotDefaults = computed(() => ({
86
86
  fixed: wasPropPassed("fixed") ? props.fixed : void 0
87
87
  })
88
88
  }));
89
+ provide(ORIGAM_TABS_COLOR_KEY, toRef(props, "color"));
89
90
  const ariaOrientation = computed(() => props.direction === DIRECTION.VERTICAL ? "vertical" : "horizontal");
90
91
  const focusTab = (id2) => {
91
92
  if (!rootRef.value) return;
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ORIGAM_TAB_PANELS_LINK_KEY = exports.ORIGAM_TAB_PANELS_KEY = exports.ORIGAM_TAB_PANELS_CTX_KEY = exports.ORIGAM_TABS_LINK_KEY = exports.ORIGAM_TABS_KEY = void 0;
6
+ exports.ORIGAM_TAB_PANELS_LINK_KEY = exports.ORIGAM_TAB_PANELS_KEY = exports.ORIGAM_TAB_PANELS_CTX_KEY = exports.ORIGAM_TABS_LINK_KEY = exports.ORIGAM_TABS_KEY = exports.ORIGAM_TABS_COLOR_KEY = void 0;
7
7
  const ORIGAM_TABS_KEY = exports.ORIGAM_TABS_KEY = /* @__PURE__ */Symbol.for("origam:tabs");
8
+ const ORIGAM_TABS_COLOR_KEY = exports.ORIGAM_TABS_COLOR_KEY = /* @__PURE__ */Symbol.for("origam:tabs-color");
8
9
  const ORIGAM_TAB_PANELS_KEY = exports.ORIGAM_TAB_PANELS_KEY = /* @__PURE__ */Symbol.for("origam:tab-panels");
9
10
  const ORIGAM_TAB_PANELS_CTX_KEY = exports.ORIGAM_TAB_PANELS_CTX_KEY = /* @__PURE__ */Symbol.for("origam:tab-panels-ctx");
10
11
  const ORIGAM_TAB_PANELS_LINK_KEY = exports.ORIGAM_TAB_PANELS_LINK_KEY = /* @__PURE__ */Symbol.for("origam:tab-panels-link");
@@ -1,4 +1,5 @@
1
1
  import type { InjectionKey, Ref } from 'vue';
2
+ import type { TColor } from '../../types/Commons/color.type';
2
3
  import type { IGroupProvide } from '../../interfaces/Commons/group.interface';
3
4
  import type { ITabPanelsProvide } from '../../interfaces/Tabs/tab-panels.interface';
4
5
  /**
@@ -9,6 +10,13 @@ import type { ITabPanelsProvide } from '../../interfaces/Tabs/tab-panels.interfa
9
10
  * its items with the outer group.
10
11
  */
11
12
  export declare const ORIGAM_TABS_KEY: InjectionKey<IGroupProvide>;
13
+ /*********************************************************
14
+ * ORIGAM_TABS_COLOR_KEY (#1253)
15
+ *
16
+ * @description
17
+ * `<OrigamTabs>` `color`, provided reactively so each `<OrigamTab>` can paint its pills active surface without a forwarded default.
18
+ ********************************************************/
19
+ export declare const ORIGAM_TABS_COLOR_KEY: InjectionKey<Ref<TColor | undefined>>;
12
20
  /**
13
21
  * Injection key shared by `<OrigamTabPanels>` (provider) and
14
22
  * `<OrigamTabPanel>` (consumer). The panels group is kept distinct
@@ -1,4 +1,5 @@
1
1
  export const ORIGAM_TABS_KEY = /* @__PURE__ */ Symbol.for("origam:tabs");
2
+ export const ORIGAM_TABS_COLOR_KEY = /* @__PURE__ */ Symbol.for("origam:tabs-color");
2
3
  export const ORIGAM_TAB_PANELS_KEY = /* @__PURE__ */ Symbol.for("origam:tab-panels");
3
4
  export const ORIGAM_TAB_PANELS_CTX_KEY = /* @__PURE__ */ Symbol.for("origam:tab-panels-ctx");
4
5
  export const ORIGAM_TAB_PANELS_LINK_KEY = /* @__PURE__ */ Symbol.for("origam:tab-panels-link");
@@ -1,4 +1,5 @@
1
1
  import type { IAdjacentProps } from '../Commons/adjacent.interface';
2
+ import type { IColorProps } from '../Commons/color.interface';
2
3
  import type { ICommonsComponentProps, ITagProps } from '../Commons/commons.interface';
3
4
  import type { IGroupEmits, IGroupItemProps } from '../Commons/group.interface';
4
5
  import type { ITypographyProps } from '../Commons/typography.interface';
@@ -25,7 +26,7 @@ import type { TTabVariant } from '../../types/Tabs/tab.type';
25
26
  * `lineHeight` is intentionally excluded — the SCSS hard-codes `line-height: 1`
26
27
  * with no CSS-var hook.
27
28
  */
28
- export interface ITabProps extends ICommonsComponentProps, ITagProps, IGroupItemProps, Pick<ITypographyProps, 'fontSize' | 'fontWeight' | 'letterSpacing'>, IAdjacentProps {
29
+ export interface ITabProps extends ICommonsComponentProps, ITagProps, IGroupItemProps, IColorProps, Pick<ITypographyProps, 'fontSize' | 'fontWeight' | 'letterSpacing'>, IAdjacentProps {
29
30
  tag?: string;
30
31
  /** Text label — used when the `default` slot is not provided. */
31
32
  text?: string;