origam 2.37.33 → 2.37.35

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.
@@ -306,6 +306,8 @@
306
306
  --origam-btn---density: 0px;
307
307
  --origam-btn---width: auto;
308
308
  --origam-btn---min-width: 64px;
309
+ --origam-btn__content---justify-content: center;
310
+ --origam-btn__content---text-align: center;
309
311
  --origam-btn---max-width: 100%;
310
312
  --origam-btn---height: var(--origam-btn---height-md, 36px);
311
313
  --origam-btn---max-height: 100%;
@@ -3352,6 +3354,8 @@
3352
3354
  --origam-btn---density: 0px;
3353
3355
  --origam-btn---width: auto;
3354
3356
  --origam-btn---min-width: 64px;
3357
+ --origam-btn__content---justify-content: center;
3358
+ --origam-btn__content---text-align: center;
3355
3359
  --origam-btn---max-width: 100%;
3356
3360
  --origam-btn---height: var(--origam-btn---height-md, 36px);
3357
3361
  --origam-btn---max-height: 100%;
@@ -206,6 +206,8 @@
206
206
  --origam-btn---density: 0px;
207
207
  --origam-btn---width: auto;
208
208
  --origam-btn---min-width: 64px;
209
+ --origam-btn__content---justify-content: center;
210
+ --origam-btn__content---text-align: center;
209
211
  --origam-btn---max-width: 100%;
210
212
  --origam-btn---height: var(--origam-btn---height-md, 36px);
211
213
  --origam-btn---max-height: 100%;
@@ -306,6 +306,8 @@
306
306
  --origam-btn---density: 0px;
307
307
  --origam-btn---width: auto;
308
308
  --origam-btn---min-width: 64px;
309
+ --origam-btn__content---justify-content: center;
310
+ --origam-btn__content---text-align: center;
309
311
  --origam-btn---max-width: 100%;
310
312
  --origam-btn---height: var(--origam-btn---height-md, 36px);
311
313
  --origam-btn---max-height: 100%;
@@ -3352,6 +3354,8 @@
3352
3354
  --origam-btn---density: 0px;
3353
3355
  --origam-btn---width: auto;
3354
3356
  --origam-btn---min-width: 64px;
3357
+ --origam-btn__content---justify-content: center;
3358
+ --origam-btn__content---text-align: center;
3355
3359
  --origam-btn---max-width: 100%;
3356
3360
  --origam-btn---height: var(--origam-btn---height-md, 36px);
3357
3361
  --origam-btn---max-height: 100%;
@@ -206,6 +206,8 @@
206
206
  --origam-btn---density: 0px;
207
207
  --origam-btn---width: auto;
208
208
  --origam-btn---min-width: 64px;
209
+ --origam-btn__content---justify-content: center;
210
+ --origam-btn__content---text-align: center;
209
211
  --origam-btn---max-width: 100%;
210
212
  --origam-btn---height: var(--origam-btn---height-md, 36px);
211
213
  --origam-btn---max-height: 100%;
@@ -214,7 +214,7 @@ const props = defineProps({
214
214
  status: { type: null, required: false },
215
215
  statusIconPosition: { type: null, required: false },
216
216
  icon: { type: null, required: false },
217
- hover: { type: [Boolean, Object], required: false, default: true },
217
+ hover: { type: [Boolean, Object], required: false, default: false },
218
218
  hoverClass: { type: String, required: false },
219
219
  appendAvatar: { type: String, required: false },
220
220
  appendIcon: { type: null, required: false },
@@ -233,7 +233,8 @@ const slots = useSlots();
233
233
  const { filterProps } = useProps(props);
234
234
  const { t } = useLocale();
235
235
  const { typographyStyles } = useTypography(props, "alert__title");
236
- const { classes: activeClasses, isOn: isActive, config: activeState, toggle: onActive } = useStateFlag(props, { state: "active", source: "modelValue" });
236
+ const { isOn: isActive, toggle: onActive } = useStateFlag(props, { state: "active", source: "modelValue" });
237
+ const isPressed = computed(() => false);
237
238
  const {
238
239
  isOn: isHover,
239
240
  config: hoverState,
@@ -254,7 +255,7 @@ const {
254
255
  paddingStyles,
255
256
  marginClasses,
256
257
  marginStyles
257
- } = useStateEffect(props, isHover, isActive, hoverState, activeState);
258
+ } = useStateEffect(props, isHover, isPressed, hoverState, void 0);
258
259
  const { icon, prependIcon, appendIcon, statusClasses } = useStatus(props);
259
260
  const {
260
261
  onClickPrepend: handleClickPrepend,
@@ -307,7 +308,6 @@ const alertClasses = computed(() => {
307
308
  return [
308
309
  "origam-alert",
309
310
  hoverClasses.value,
310
- activeClasses.value,
311
311
  statusClasses.value,
312
312
  colorClasses.value,
313
313
  densityClasses.value,
@@ -104,7 +104,7 @@ import { useStyle } from "../../composables/Commons/style.composable";
104
104
  import { useTypography } from "../../composables/Commons/typography.composable";
105
105
  import vContrast from "../../directives/Contrast/contrast.directive";
106
106
  import { omit, pick } from "../../utils/Commons/commons.util";
107
- import { computed, ComputedRef, StyleValue, useAttrs } from "vue";
107
+ import { computed, ref, StyleValue, useAttrs } from "vue";
108
108
  const props = defineProps({
109
109
  content: { type: [Number, String], required: false },
110
110
  dot: { type: Boolean, required: false },
@@ -174,8 +174,8 @@ const { filterProps } = useProps(props);
174
174
  const { t } = useLocale();
175
175
  const attrs = useAttrs();
176
176
  const { classes: hoverClasses, isOn: isHover, config: hoverState, unset: handleMouseleave, set: handleMouseenter } = useStateFlag(props, { state: "hover" });
177
- const { classes: activeClasses, isOn: isActive, config: activeState } = useStateFlag(props, { state: "active", source: "modelValue" });
178
- const { colorClasses, colorStyles, borderClasses, borderStyles, roundedClasses, roundedStyles, elevationClasses, elevationStyles } = useStateEffect(props, isHover, isActive, hoverState, activeState);
177
+ const { classes: activeClasses } = useStateFlag(props, { state: "active", source: "modelValue" });
178
+ const { colorClasses, colorStyles, borderClasses, borderStyles, roundedClasses, roundedStyles, elevationClasses, elevationStyles } = useStateEffect(props, isHover, ref(false), hoverState, void 0);
179
179
  const { typographyStyles } = useTypography(props, "badge__badge");
180
180
  const { icon, prependIcon, appendIcon, statusClasses } = useStatus(props);
181
181
  const {
@@ -239,8 +239,8 @@ const badgeClasses = computed(() => {
239
239
  "origam-badge--floating": props.floating,
240
240
  "origam-badge--inline": props.inline
241
241
  },
242
- activeClasses.value,
243
242
  hoverClasses.value,
243
+ activeClasses.value,
244
244
  statusClasses.value,
245
245
  props.class
246
246
  ];
@@ -1118,7 +1118,7 @@ defineExpose({
1118
1118
  &--wrap {
1119
1119
  #{$this}__content {
1120
1120
  white-space: normal;
1121
- text-align: center;
1121
+ text-align: var(--origam-btn__content---text-align, center);
1122
1122
  }
1123
1123
  }
1124
1124
 
@@ -1193,7 +1193,7 @@ defineExpose({
1193
1193
 
1194
1194
  &__content {
1195
1195
  grid-area: content;
1196
- justify-content: center;
1196
+ justify-content: var(--origam-btn__content---justify-content, center);
1197
1197
  white-space: nowrap;
1198
1198
 
1199
1199
  margin-inline-start: var(--origam-btn__content---margin-inline-start);
@@ -28,7 +28,7 @@ module.exports = (0, _app.defineNuxtPlugin)({
28
28
  });
29
29
  const modePinned = (0, _applyTheme.isModePinned)(modeCookie.value, config.defaultMode);
30
30
  const themeFromDom = typeof document !== "undefined" && document.documentElement.dataset.theme || null;
31
- const initialTheme = themeFromDom ?? themeCookie.value ?? config.defaultTheme;
31
+ const initialTheme = (0, _applyTheme.knownBrand)(themeFromDom, config.themes) ?? (0, _applyTheme.knownBrand)(themeCookie.value, config.themes) ?? config.defaultTheme;
32
32
  const initialMode = modeCookie.value ?? config.defaultMode;
33
33
  const themes = config.themes ?? [];
34
34
  const origam = (0, _origam.createOrigam)({
@@ -3,7 +3,7 @@ import { useTheme } from "../composables/Commons/theme.composable.js";
3
3
  import { createOrigam } from "../origam.js";
4
4
  import { nuxtIconsOptions } from "../utils/Commons/nuxt-icons.util.js";
5
5
  import { nuxtLocaleOptions } from "../utils/Commons/nuxt-locale.util.js";
6
- import { isModePinned } from "../utils/Commons/apply-theme.util.js";
6
+ import { isModePinned, knownBrand } from "../utils/Commons/apply-theme.util.js";
7
7
  import { defineNuxtPlugin, useCookie, useRuntimeConfig } from "#app";
8
8
  export default defineNuxtPlugin({
9
9
  name: "origam:client",
@@ -22,7 +22,7 @@ export default defineNuxtPlugin({
22
22
  });
23
23
  const modePinned = isModePinned(modeCookie.value, config.defaultMode);
24
24
  const themeFromDom = typeof document !== "undefined" && document.documentElement.dataset.theme || null;
25
- const initialTheme = themeFromDom ?? themeCookie.value ?? config.defaultTheme;
25
+ const initialTheme = knownBrand(themeFromDom, config.themes) ?? knownBrand(themeCookie.value, config.themes) ?? config.defaultTheme;
26
26
  const initialMode = modeCookie.value ?? config.defaultMode;
27
27
  const themes = config.themes ?? [];
28
28
  const origam = createOrigam({ themes, ssr: true, ...nuxtLocaleOptions(config), ...nuxtIconsOptions(config) });
@@ -12,8 +12,9 @@ var _ssrStyles = require("../utils/Commons/ssr-styles.util.cjs");
12
12
  var _theme = require("../consts/Commons/theme.const.cjs");
13
13
  var _app = require("#app");
14
14
  function resolveServerTheme(cookieValue, config) {
15
- if (cookieValue && cookieValue !== _theme.ORIGAM_THEME_AUTO) {
16
- return cookieValue;
15
+ const brand = (0, _applyTheme.knownBrand)(cookieValue, config.themes);
16
+ if (brand && brand !== _theme.ORIGAM_THEME_AUTO) {
17
+ return brand;
17
18
  }
18
19
  if (config.defaultTheme && config.defaultTheme !== _theme.ORIGAM_THEME_AUTO) {
19
20
  return config.defaultTheme;
@@ -1,13 +1,14 @@
1
1
  import { createOrigam } from "../origam.js";
2
2
  import { nuxtIconsOptions } from "../utils/Commons/nuxt-icons.util.js";
3
3
  import { nuxtLocaleOptions } from "../utils/Commons/nuxt-locale.util.js";
4
- import { isModePinned, themeToCss, themeToUnpinnedCss } from "../utils/Commons/apply-theme.util.js";
4
+ import { isModePinned, knownBrand, themeToCss, themeToUnpinnedCss } from "../utils/Commons/apply-theme.util.js";
5
5
  import { getSsrStyles } from "../utils/Commons/ssr-styles.util.js";
6
6
  import { ORIGAM_MODE_ATTR, ORIGAM_MODE_DARK, ORIGAM_MODE_LIGHT, ORIGAM_THEME_ATTR, ORIGAM_THEME_AUTO } from "../consts/Commons/theme.const.js";
7
7
  import { defineNuxtPlugin, useCookie, useHead, useRuntimeConfig } from "#app";
8
8
  function resolveServerTheme(cookieValue, config) {
9
- if (cookieValue && cookieValue !== ORIGAM_THEME_AUTO) {
10
- return cookieValue;
9
+ const brand = knownBrand(cookieValue, config.themes);
10
+ if (brand && brand !== ORIGAM_THEME_AUTO) {
11
+ return brand;
11
12
  }
12
13
  if (config.defaultTheme && config.defaultTheme !== ORIGAM_THEME_AUTO) {
13
14
  return config.defaultTheme;