origam 2.21.0 → 2.23.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/CHANGELOG.md +95 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +8 -0
- package/dist/src/assets/css/tokens/light.css +3 -0
- package/dist/src/assets/scss/tokens/_dark.scss +8 -0
- package/dist/src/assets/scss/tokens/_light.scss +3 -0
- package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +8 -2
- package/dist/src/components/ContextualMenu/OrigamContextualMenu.vue +1 -1
- package/dist/src/components/Dialog/OrigamDialog.vue +1 -1
- package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +1 -1
- package/dist/src/components/Drawer/OrigamDrawer.vue +12 -2
- package/dist/src/components/Menu/OrigamMenu.vue +1 -1
- package/dist/src/components/Overlay/OrigamOverlay.vue +2 -2
- package/dist/src/components/Snackbar/OrigamSnackbar.vue +1 -1
- package/dist/src/components/Snackbar/OrigamSnackbarGroup.vue +8 -2
- package/dist/src/components/Tooltip/OrigamTooltip.vue +1 -1
- package/dist/src/composables/Code/code.composable.cjs +7 -5
- package/dist/src/composables/Code/code.composable.d.ts +7 -0
- package/dist/src/composables/Code/code.composable.js +8 -6
- package/dist/src/composables/Commons/hydration.composable.cjs +8 -3
- package/dist/src/composables/Commons/hydration.composable.d.ts +13 -5
- package/dist/src/composables/Commons/hydration.composable.js +6 -1
- package/dist/src/composables/Commons/teleport.composable.cjs +3 -0
- package/dist/src/composables/Commons/teleport.composable.d.ts +56 -0
- package/dist/src/composables/Commons/teleport.composable.js +3 -0
- package/dist/src/composables/Commons/variant.composable.d.ts +11 -3
- package/dist/src/consts/Code/code.const.cjs +3 -2
- package/dist/src/consts/Code/code.const.d.ts +14 -0
- package/dist/src/consts/Code/code.const.js +1 -0
- package/dist/src/interfaces/Btn/btn-group.interface.d.ts +2 -2
- package/dist/src/interfaces/Btn/btn.interface.d.ts +2 -2
- package/dist/src/interfaces/Code/code.interface.d.ts +33 -1
- package/dist/src/interfaces/CommandPalette/command-palette.interface.d.ts +2 -1
- package/dist/src/interfaces/Commons/attach.interface.cjs +1 -0
- package/dist/src/interfaces/Commons/attach.interface.d.ts +30 -0
- package/dist/src/interfaces/Commons/attach.interface.js +0 -0
- package/dist/src/interfaces/Commons/commons.interface.d.ts +2 -0
- package/dist/src/interfaces/Commons/variant.interface.d.ts +30 -8
- package/dist/src/interfaces/ConfirmWrapper/confirm-wrapper.interface.d.ts +7 -2
- package/dist/src/interfaces/Drawer/drawer.interface.d.ts +24 -1
- package/dist/src/interfaces/Field/field.interface.d.ts +2 -2
- package/dist/src/interfaces/NumberField/number-field.interface.d.ts +2 -2
- package/dist/src/interfaces/OtpInputField/otp-input-field.interface.d.ts +2 -2
- package/dist/src/interfaces/Overlay/overlay.interface.d.ts +2 -2
- package/dist/src/interfaces/Snackbar/snackbar-group.interface.d.ts +2 -1
- package/dist/src/interfaces/index.cjs +11 -0
- package/dist/src/interfaces/index.d.ts +1 -0
- package/dist/src/interfaces/index.js +1 -0
- package/dist/src/origam.cjs +1 -0
- package/dist/src/origam.js +2 -0
- package/dist/src/themes/origam.theme.cjs +10 -1
- package/dist/src/themes/origam.theme.js +10 -1
- package/dist/src/types/Code/code.type.d.ts +29 -0
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
1
2
|
import { CODE_LANG } from '../../enums';
|
|
3
|
+
import type { ICodeOptions } from '../../interfaces/Code/code.interface';
|
|
2
4
|
/**
|
|
3
5
|
* Languages bundled with the default shiki highlighter. Keep this list and
|
|
4
6
|
* the `langs` argument of `createHighlighter()` in lockstep — see
|
|
@@ -51,3 +53,15 @@ export declare const CODE_DEFAULTS: Readonly<{
|
|
|
51
53
|
*/
|
|
52
54
|
readonly copyFeedbackDurationMs: 2000;
|
|
53
55
|
}>;
|
|
56
|
+
/*********************************************************
|
|
57
|
+
* ORIGAM_CODE_KEY
|
|
58
|
+
*
|
|
59
|
+
* @description
|
|
60
|
+
* Provide/inject key for the `code` block of `createOrigam()`'s options
|
|
61
|
+
* (`ICodeOptions` — today just `highlighter`). `useCode()` reads it via
|
|
62
|
+
* `inject(ORIGAM_CODE_KEY)` — optional on purpose: an app that never calls
|
|
63
|
+
* `createOrigam({ code })`, or that never installs the plugin at all, gets
|
|
64
|
+
* `undefined` and `loadHighlighter()` falls back to the DS's own
|
|
65
|
+
* `import('shiki')` path unchanged. See `code.composable.ts`.
|
|
66
|
+
********************************************************/
|
|
67
|
+
export declare const ORIGAM_CODE_KEY: InjectionKey<ICodeOptions>;
|
|
@@ -10,8 +10,8 @@ import type { IMarginProps } from '../Commons/margin.interface';
|
|
|
10
10
|
import type { IPaddingProps } from '../Commons/padding.interface';
|
|
11
11
|
import type { IRoundedProps } from '../Commons/rounded.interface';
|
|
12
12
|
import type { ISizeProps } from '../Commons/size.interface';
|
|
13
|
-
import type {
|
|
14
|
-
export interface IBtnGroupProps extends ITagProps, ICommonsComponentProps, IRoundedProps, IBorderProps, IDensityProps, IElevationProps, IColorProps, IBgColorProps, IMarginProps, IPaddingProps, IHoverProps, IActiveProps,
|
|
13
|
+
import type { IActionVariantProps } from '../Commons/variant.interface';
|
|
14
|
+
export interface IBtnGroupProps extends ITagProps, ICommonsComponentProps, IRoundedProps, IBorderProps, IDensityProps, IElevationProps, IColorProps, IBgColorProps, IMarginProps, IPaddingProps, IHoverProps, IActiveProps, IActionVariantProps, ISizeProps {
|
|
15
15
|
divided?: boolean;
|
|
16
16
|
items?: Array<IBtnProps>;
|
|
17
17
|
}
|
|
@@ -18,14 +18,14 @@ import type { IRippleProps } from '../Commons/ripple.interface';
|
|
|
18
18
|
import type { IRoundedProps } from '../Commons/rounded.interface';
|
|
19
19
|
import type { ISizeProps } from '../Commons/size.interface';
|
|
20
20
|
import type { ITypographyProps } from '../Commons/typography.interface';
|
|
21
|
-
import type {
|
|
21
|
+
import type { IActionVariantProps } from '../Commons/variant.interface';
|
|
22
22
|
import type { TIcon } from '../../types/Icon/icon.type';
|
|
23
23
|
import type { TStatus, TStatusPosition } from '../../types/Commons/status.type';
|
|
24
24
|
/** Btn needs `status` / `statusIconPosition` from IStatusProps but its own
|
|
25
25
|
* `icon` prop accepts `boolean | TIcon` (boolean = icon-only mode) which is
|
|
26
26
|
* wider than `IIconProps.icon?: TIcon`. Pulling the two status props in
|
|
27
27
|
* directly avoids the TS2430 incompatible-extends error. */
|
|
28
|
-
export interface IBtnProps extends ICommonsComponentProps, IColorProps, IBgColorProps, IBorderProps, IDensityProps, IDimensionProps, IElevationProps, IRoundedProps, ITagProps, ISizeProps, ILinkProps, IRippleProps, ILoaderProps, IPositionProps, ILocationProps, IGroupItemProps, IPaddingProps, IMarginProps, IAdjacentProps, IHoverProps, IActiveProps,
|
|
28
|
+
export interface IBtnProps extends ICommonsComponentProps, IColorProps, IBgColorProps, IBorderProps, IDensityProps, IDimensionProps, IElevationProps, IRoundedProps, ITagProps, ISizeProps, ILinkProps, IRippleProps, ILoaderProps, IPositionProps, ILocationProps, IGroupItemProps, IPaddingProps, IMarginProps, IAdjacentProps, IHoverProps, IActiveProps, IActionVariantProps, Pick<ITypographyProps, 'fontSize' | 'fontWeight' | 'lineHeight' | 'letterSpacing'> {
|
|
29
29
|
/** @deprecated Use `variant="flat"` instead. Kept for backward compat. */
|
|
30
30
|
flat?: boolean;
|
|
31
31
|
/** Pass `true` to activate icon-only mode; pass a `TIcon` value to set the icon. */
|
|
@@ -7,7 +7,7 @@ import type { IMarginProps } from '../Commons/margin.interface';
|
|
|
7
7
|
import type { IPaddingProps } from '../Commons/padding.interface';
|
|
8
8
|
import type { IRoundedProps } from '../Commons/rounded.interface';
|
|
9
9
|
import type { ITypographyProps } from '../Commons/typography.interface';
|
|
10
|
-
import type { TCodeLang } from '../../types/Code/code.type';
|
|
10
|
+
import type { TCodeLang, TShikiHighlighterLoader } from '../../types/Code/code.type';
|
|
11
11
|
/**
|
|
12
12
|
* Props for `<OrigamCode>` — a shiki-powered code block with line numbers,
|
|
13
13
|
* line highlighting, copy button and theme awareness.
|
|
@@ -85,6 +85,38 @@ export interface ICodeProps extends ICommonsComponentProps, ITagProps, IBorderPr
|
|
|
85
85
|
*/
|
|
86
86
|
prompt?: string;
|
|
87
87
|
}
|
|
88
|
+
/*********************************************************
|
|
89
|
+
* ICodeOptions
|
|
90
|
+
*
|
|
91
|
+
* @description
|
|
92
|
+
* App-level config for `<OrigamCode>`, passed via `createOrigam({ code })`.
|
|
93
|
+
* Today it carries a single knob — `highlighter` — but it is its own
|
|
94
|
+
* interface (rather than a bare function on `IOrigamOptions`) so a future
|
|
95
|
+
* `OrigamCode`-wide setting (e.g. a default theme pair) has somewhere to
|
|
96
|
+
* land without another breaking shape change.
|
|
97
|
+
*
|
|
98
|
+
* @description
|
|
99
|
+
* `highlighter` supplies your own shiki-compatible module loader instead of
|
|
100
|
+
* the DS's default `import('shiki')` (see `code.composable.ts`'s
|
|
101
|
+
* `loadHighlighter()`). Absent (default) — `useCode()` keeps loading the
|
|
102
|
+
* full `shiki` package exactly as before, nothing changes for a consumer
|
|
103
|
+
* who does not set this. Supplied — the DS never touches `shiki` itself: no
|
|
104
|
+
* bare-specifier dynamic import, no `@vite-ignore`, no WASM-loader chunk in
|
|
105
|
+
* THIS path. Typical use: an app bundling `shiki/core` + a JS regex engine
|
|
106
|
+
* (no WASM loader, no oniguruma binary) to shrink the syntax-highlighting
|
|
107
|
+
* cost — any module exposing `createHighlighter` works, see `TShikiModule`.
|
|
108
|
+
*
|
|
109
|
+
* @description
|
|
110
|
+
* The loader is read once, synchronously, the first time `useCode()` is
|
|
111
|
+
* invoked inside a mounted `<OrigamCode>` — `useCode()` is a module-scoped
|
|
112
|
+
* singleton (one highlighter promise for the whole page), so the FIRST
|
|
113
|
+
* instance to resolve it wins for the lifetime of the page; later instances
|
|
114
|
+
* reuse that same highlighter regardless of their own `createOrigam()`
|
|
115
|
+
* ancestor.
|
|
116
|
+
********************************************************/
|
|
117
|
+
export interface ICodeOptions {
|
|
118
|
+
highlighter?: TShikiHighlighterLoader;
|
|
119
|
+
}
|
|
88
120
|
/** Emits fired by `<OrigamCode>` — copy-to-clipboard confirmation. */
|
|
89
121
|
export interface ICodeEmits {
|
|
90
122
|
(e: 'copy', code: string): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ICommand } from './command.interface';
|
|
2
|
+
import type { IAttachProps } from '../Commons/attach.interface';
|
|
2
3
|
import type { ICommonsComponentProps } from '../Commons/commons.interface';
|
|
3
4
|
import type { ITypographyProps } from '../Commons/typography.interface';
|
|
4
5
|
/**
|
|
@@ -11,7 +12,7 @@ import type { ITypographyProps } from '../Commons/typography.interface';
|
|
|
11
12
|
* the listeners so consumers can pass either form interchangeably.
|
|
12
13
|
*/
|
|
13
14
|
export type TCommandPaletteHotkey = ReadonlyArray<string> | ReadonlyArray<ReadonlyArray<string>>;
|
|
14
|
-
export interface ICommandPaletteProps extends ICommonsComponentProps, Pick<ITypographyProps, 'fontSize'
|
|
15
|
+
export interface ICommandPaletteProps extends ICommonsComponentProps, Pick<ITypographyProps, 'fontSize'>, IAttachProps {
|
|
15
16
|
/** v-model — whether the palette is open. */
|
|
16
17
|
modelValue?: boolean;
|
|
17
18
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `attach` — the teleport target for a component's floating / portal
|
|
3
|
+
* surface, resolved through `useTeleport()`
|
|
4
|
+
* (`composables/Commons/teleport.composable.ts`), the SINGLE consumption
|
|
5
|
+
* point for the whole DS. Extracted from `IOverlayProps` (#attach-
|
|
6
|
+
* harmonisation) so every component that teleports declares the exact
|
|
7
|
+
* same surface instead of a half-implemented, hand-rolled `to="body"`.
|
|
8
|
+
*
|
|
9
|
+
* • `true` → no teleport, render in place.
|
|
10
|
+
* • `false` / unset → `document.body`. Vue's boolean-prop casting
|
|
11
|
+
* defaults an ABSENT prop whose declared type
|
|
12
|
+
* includes `Boolean` to `false` when the
|
|
13
|
+
* component declares no `default` for it — so
|
|
14
|
+
* "not passed" and "passed `false`" resolve
|
|
15
|
+
* identically to `document.body` by design
|
|
16
|
+
* (see `OrigamOverlay`, `OrigamMenu`).
|
|
17
|
+
* • a CSS selector string → resolved against `document.querySelector`.
|
|
18
|
+
* • an `Element` → used directly as the teleport container.
|
|
19
|
+
* • `null` → reserved for a component whose OWN default
|
|
20
|
+
* is not `document.body` (`OrigamDrawer`
|
|
21
|
+
* teleports into its `<OrigamLayout>` wrapper
|
|
22
|
+
* by default) and therefore needs a THIRD
|
|
23
|
+
* state, distinguishable from an explicit
|
|
24
|
+
* `false`, to fall back to that non-body
|
|
25
|
+
* default instead. Same tri-state pattern as
|
|
26
|
+
* `IDrawerProps.push` / `.clipped`.
|
|
27
|
+
*/
|
|
28
|
+
export interface IAttachProps {
|
|
29
|
+
attach?: boolean | string | Element | null;
|
|
30
|
+
}
|
|
File without changes
|
|
@@ -6,6 +6,7 @@ import type { IDisplayOptions } from './display.interface';
|
|
|
6
6
|
import type { IGoToOptions } from './goTo.interface';
|
|
7
7
|
import type { ILocaleOptions, IRtlOptions } from './locale.interface';
|
|
8
8
|
import type { IOrigamTheme } from './theme.interface';
|
|
9
|
+
import type { ICodeOptions } from '../Code/code.interface';
|
|
9
10
|
import { TIconOptions } from '../../types/Icon/icon.type';
|
|
10
11
|
import { TOrigamPluginOptionsImport } from '../../types/Commons/commons.type';
|
|
11
12
|
import { TSSROptions } from '../../types/Commons/display.type';
|
|
@@ -53,6 +54,7 @@ export interface IOrigamOptions {
|
|
|
53
54
|
* injected. SSR-safe (injection is a no-op without `document`).
|
|
54
55
|
*/
|
|
55
56
|
themes?: IOrigamTheme[];
|
|
57
|
+
code?: ICodeOptions;
|
|
56
58
|
}
|
|
57
59
|
export interface IOrigamPluginOptions {
|
|
58
60
|
autoImport?: TOrigamPluginOptionsImport;
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import type { TVariant, TVariantInput } from '../../types/Commons/variant.type';
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
/*********************************************************
|
|
3
|
+
* IActionVariantProps
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* Mixin props for ACTION-style surfaces (Btn, BtnGroup, BtnToggle…) — the
|
|
7
|
+
* `VARIANT` enum taxonomy (`text/flat/elevated/tonal/outlined/plain/ghost`).
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* Split from the former single `IVariantProps` (#1050 / ADR-005 follow-up):
|
|
11
|
+
* that mixin's union accepted BOTH this family's 7 values AND the input
|
|
12
|
+
* family's 5, so every one of the 14 consumers silently accepted 3-5 values
|
|
13
|
+
* it never implements (`underlined`/`filled`/`solo` here). Each family now
|
|
14
|
+
* only names the vocabulary it actually renders.
|
|
15
|
+
********************************************************/
|
|
16
|
+
export interface IActionVariantProps {
|
|
17
|
+
variant?: TVariant;
|
|
18
|
+
}
|
|
19
|
+
/*********************************************************
|
|
20
|
+
* IInputVariantProps
|
|
21
|
+
*
|
|
22
|
+
* @description
|
|
23
|
+
* Mixin props for INPUT-style surfaces (Field and its descendants,
|
|
24
|
+
* ConfirmWrapper) — the `VARIANT_INPUT` enum taxonomy
|
|
25
|
+
* (`underlined/filled/solo/outlined/plain`).
|
|
26
|
+
*
|
|
27
|
+
* @description
|
|
28
|
+
* See `IActionVariantProps` above for why this was split out.
|
|
29
|
+
********************************************************/
|
|
30
|
+
export interface IInputVariantProps {
|
|
31
|
+
variant?: TVariantInput;
|
|
10
32
|
}
|
|
@@ -6,7 +6,7 @@ import type { IDirectionProps } from '../Commons/direction.interface';
|
|
|
6
6
|
import type { IElevationProps } from '../Commons/elevation.interface';
|
|
7
7
|
import type { IFocusProps } from '../Commons/focus.interface';
|
|
8
8
|
import type { IRoundedProps } from '../Commons/rounded.interface';
|
|
9
|
-
import type {
|
|
9
|
+
import type { IInputVariantProps } from '../Commons/variant.interface';
|
|
10
10
|
/**
|
|
11
11
|
* Props for `<OrigamConfirmWrapper>` — a "type-it-twice" form helper that
|
|
12
12
|
* pairs a primary input with a confirmation input and lights up only when
|
|
@@ -15,8 +15,13 @@ import type { IVariantProps } from '../Commons/variant.interface';
|
|
|
15
15
|
*
|
|
16
16
|
* Inherits the standard form mixins so it slots into a Field/Form pipeline
|
|
17
17
|
* alongside any other input control.
|
|
18
|
+
*
|
|
19
|
+
* `variant` is `IInputVariantProps` (not `IActionVariantProps`) — decided by
|
|
20
|
+
* the owner: ConfirmWrapper wraps form fields, so it only pushes a FIELD
|
|
21
|
+
* variant (`underlined/filled/solo/outlined/plain`), never an action-style
|
|
22
|
+
* one (#1050).
|
|
18
23
|
*/
|
|
19
|
-
export interface IConfirmWrapperProps extends ICommonsComponentProps, IAdjacentProps, IDirectionProps, IColorProps, IDensityProps, IRoundedProps, IElevationProps,
|
|
24
|
+
export interface IConfirmWrapperProps extends ICommonsComponentProps, IAdjacentProps, IDirectionProps, IColorProps, IDensityProps, IRoundedProps, IElevationProps, IInputVariantProps, IFocusProps {
|
|
20
25
|
modelValue?: any;
|
|
21
26
|
confirm?: any;
|
|
22
27
|
field?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IActiveProps } from '../Commons/active.interface';
|
|
2
2
|
import type { IAdjacentSlots } from '../Commons/adjacent.interface';
|
|
3
|
+
import type { IAttachProps } from '../Commons/attach.interface';
|
|
3
4
|
import type { IBgColorProps, IColorProps } from '../Commons/color.interface';
|
|
4
5
|
import type { IBorderProps } from '../Commons/border.interface';
|
|
5
6
|
import type { ICommonsComponentEmits, ICommonsComponentProps, ITagProps } from '../Commons/commons.interface';
|
|
@@ -12,7 +13,7 @@ import type { IPaddingProps } from '../Commons/padding.interface';
|
|
|
12
13
|
import type { IRoundedProps } from '../Commons/rounded.interface';
|
|
13
14
|
import type { IScrimProps } from '../Overlay/overlay-scrim.interface';
|
|
14
15
|
import type { ITransitionComponentProps } from '../Commons/transition-component.interface';
|
|
15
|
-
export interface IDrawerProps extends ITagProps, ICommonsComponentProps, IBorderProps, IElevationProps, ILayoutItemProps, IRoundedProps, IColorProps, IBgColorProps, IDensityProps, IPaddingProps, IMarginProps, ITransitionComponentProps, IScrimProps, IActiveProps, IHoverProps {
|
|
16
|
+
export interface IDrawerProps extends ITagProps, ICommonsComponentProps, IBorderProps, IElevationProps, ILayoutItemProps, IRoundedProps, IColorProps, IBgColorProps, IDensityProps, IPaddingProps, IMarginProps, ITransitionComponentProps, IScrimProps, IActiveProps, IHoverProps, IAttachProps {
|
|
16
17
|
disableResizeWatcher?: boolean;
|
|
17
18
|
disableRouteWatcher?: boolean;
|
|
18
19
|
expandOnHover?: boolean;
|
|
@@ -60,6 +61,28 @@ export interface IDrawerProps extends ITagProps, ICommonsComponentProps, IBorder
|
|
|
60
61
|
* Drawer before AppBar → drawer full-height.
|
|
61
62
|
*/
|
|
62
63
|
clipped?: boolean | null;
|
|
64
|
+
/**
|
|
65
|
+
* `attach` — inherited from `IAttachProps`, re-documented here because
|
|
66
|
+
* `OrigamDrawer`'s DEFAULT target is not `document.body` like the rest
|
|
67
|
+
* of the Overlay family: it teleports into its `<OrigamLayout>`
|
|
68
|
+
* ancestor's `.origam-layout__wrapper` (by `id`, via `useLayoutItem`),
|
|
69
|
+
* or renders inline when no `<OrigamLayout>` ancestor exists (the
|
|
70
|
+
* "orphan" case).
|
|
71
|
+
*
|
|
72
|
+
* • `null` (default) → keep the layout-wrapper / orphan-inline
|
|
73
|
+
* behaviour described above. Declared as the explicit
|
|
74
|
+
* `withDefaults` value so Vue's boolean-prop casting —
|
|
75
|
+
* which would otherwise force an UNSET `attach` to
|
|
76
|
+
* `false` — never overrides it. Same device as `push` /
|
|
77
|
+
* `clipped` above.
|
|
78
|
+
* • `true` → render in place, bypassing BOTH the layout teleport
|
|
79
|
+
* AND the orphan fallback.
|
|
80
|
+
* • `false` → `document.body`, same as the rest of the Overlay
|
|
81
|
+
* family — escapes the layout wrapper entirely.
|
|
82
|
+
* • a CSS selector `string` / an `Element` → teleport there instead
|
|
83
|
+
* of the layout wrapper.
|
|
84
|
+
*/
|
|
85
|
+
attach?: boolean | string | Element | null;
|
|
63
86
|
}
|
|
64
87
|
/**
|
|
65
88
|
* Emits fired by `<OrigamDrawer>` — v-model on the open state, plus a
|
|
@@ -11,7 +11,7 @@ import type { ILoaderProps } from '../Commons/loader.interface';
|
|
|
11
11
|
import type { IRoundedProps } from '../Commons/rounded.interface';
|
|
12
12
|
import type { ISizeProps } from '../Commons/size.interface';
|
|
13
13
|
import type { ITypographyProps } from '../Commons/typography.interface';
|
|
14
|
-
import type {
|
|
14
|
+
import type { IInputVariantProps } from '../Commons/variant.interface';
|
|
15
15
|
/*********************************************************
|
|
16
16
|
* IFieldProps
|
|
17
17
|
*
|
|
@@ -31,7 +31,7 @@ import type { IVariantProps } from '../Commons/variant.interface';
|
|
|
31
31
|
* `--origam-field---border-*` token channel the three outline legs already
|
|
32
32
|
* read, so the notch keeps opening under `--active` / `--focused`.
|
|
33
33
|
********************************************************/
|
|
34
|
-
export interface IFieldProps extends ICommonsComponentProps, ILoaderProps, IColorProps, IBgColorProps, IAdjacentInnerProps, IBorderProps, IFocusProps, IDensityProps, ILabelProps, IActiveProps,
|
|
34
|
+
export interface IFieldProps extends ICommonsComponentProps, ILoaderProps, IColorProps, IBgColorProps, IAdjacentInnerProps, IBorderProps, IFocusProps, IDensityProps, ILabelProps, IActiveProps, IInputVariantProps, IRoundedProps, IElevationProps, ISizeProps, Pick<ITypographyProps, 'fontSize' | 'fontWeight' | 'lineHeight' | 'letterSpacing'> {
|
|
35
35
|
centerAffix?: boolean;
|
|
36
36
|
dirty?: boolean;
|
|
37
37
|
disabled?: boolean;
|
|
@@ -2,9 +2,9 @@ import type { IAdjacentInnerEmits } from '../Commons/adjacent.interface';
|
|
|
2
2
|
import type { IFocusEmits } from '../Commons/focus.interface';
|
|
3
3
|
import type { IFieldProps, IFieldSlots } from '../Field/field.interface';
|
|
4
4
|
import type { IInputEmits, IInputProps, IInputSlots } from '../Input/input.interface';
|
|
5
|
-
import type {
|
|
5
|
+
import type { IInputVariantProps } from '../Commons/variant.interface';
|
|
6
6
|
import type { TIcon } from '../../types/Icon/icon.type';
|
|
7
|
-
export interface INumberFieldProps extends IFieldProps, IInputProps,
|
|
7
|
+
export interface INumberFieldProps extends IFieldProps, IInputProps, IInputVariantProps {
|
|
8
8
|
autofocus?: boolean;
|
|
9
9
|
placeholder?: string;
|
|
10
10
|
persistentPlaceholder?: boolean;
|
|
@@ -3,7 +3,7 @@ import type { ICommonsComponentEmits } from '../Commons/commons.interface';
|
|
|
3
3
|
import type { IFocusEmits } from '../Commons/focus.interface';
|
|
4
4
|
import type { IFieldProps, IFieldSlots } from '../Field/field.interface';
|
|
5
5
|
import type { IInputProps, IInputSlots } from '../Input/input.interface';
|
|
6
|
-
import type {
|
|
6
|
+
import type { IInputVariantProps } from '../Commons/variant.interface';
|
|
7
7
|
import type { ITypographyProps } from '../Commons/typography.interface';
|
|
8
8
|
import type { TOtpInputFieldType } from '../../types/OtpInputField/otp-input-field.type';
|
|
9
9
|
/*********************************************************
|
|
@@ -43,7 +43,7 @@ import type { TOtpInputFieldType } from '../../types/OtpInputField/otp-input-fie
|
|
|
43
43
|
* → `IAdjacentInnerProps`, reach `<origam-field>` via `fieldProps()`, and were
|
|
44
44
|
* measured PRESENT in the same sweep.
|
|
45
45
|
********************************************************/
|
|
46
|
-
export interface IOtpInputFieldProps extends Omit<IFieldProps, 'fontFamily' | 'fontWeight' | 'lineHeight' | 'letterSpacing'>, Omit<IInputProps, 'fontFamily' | 'fontWeight' | 'lineHeight' | 'letterSpacing' | 'prependIcon' | 'appendIcon' | 'prependAvatar' | 'appendAvatar' | 'prependAriaLabel' | 'appendAriaLabel'>,
|
|
46
|
+
export interface IOtpInputFieldProps extends Omit<IFieldProps, 'fontFamily' | 'fontWeight' | 'lineHeight' | 'letterSpacing'>, Omit<IInputProps, 'fontFamily' | 'fontWeight' | 'lineHeight' | 'letterSpacing' | 'prependIcon' | 'appendIcon' | 'prependAvatar' | 'appendAvatar' | 'prependAriaLabel' | 'appendAriaLabel'>, IInputVariantProps, Pick<ITypographyProps, 'fontSize'> {
|
|
47
47
|
autofocus?: boolean;
|
|
48
48
|
divider?: string;
|
|
49
49
|
focusAll?: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IActivatorProps } from '../Commons/activator.interface';
|
|
2
|
+
import type { IAttachProps } from '../Commons/attach.interface';
|
|
2
3
|
import type { IClickOutsideEmits } from '../Commons/clickOutside.interface';
|
|
3
4
|
import type { ICommonsComponentEmits, ICommonsComponentProps } from '../Commons/commons.interface';
|
|
4
5
|
import type { IDimensionProps } from '../Commons/dimension.interface';
|
|
@@ -7,9 +8,8 @@ import type { ILocationStrategyProps } from '../Commons/location.interface';
|
|
|
7
8
|
import type { IScrimProps } from './overlay-scrim.interface';
|
|
8
9
|
import type { IScrollStrategyProps } from '../Commons/scroll.interface';
|
|
9
10
|
import type { ITransitionComponentProps } from '../Commons/transition-component.interface';
|
|
10
|
-
export interface IOverlayProps extends ICommonsComponentProps, IDimensionProps, IActivatorProps, ILocationStrategyProps, IScrollStrategyProps, ILazyProps, ITransitionComponentProps, IScrimProps {
|
|
11
|
+
export interface IOverlayProps extends ICommonsComponentProps, IDimensionProps, IActivatorProps, ILocationStrategyProps, IScrollStrategyProps, ILazyProps, ITransitionComponentProps, IScrimProps, IAttachProps {
|
|
11
12
|
absolute?: boolean;
|
|
12
|
-
attach?: boolean | string | Element;
|
|
13
13
|
closeOnBack?: boolean;
|
|
14
14
|
contentClass?: string | Array<string>;
|
|
15
15
|
contentProps?: any;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
|
+
import type { IAttachProps } from '../Commons/attach.interface';
|
|
2
3
|
import type { ICommonsComponentProps, ITagProps } from '../Commons/commons.interface';
|
|
3
4
|
import type { ISnackbarGroupItem, ISnackbarGroupItemOptions } from './snackbar-group-item.interface';
|
|
4
5
|
import type { TSnackbarGroupDirection, TSnackbarGroupLocation } from '../../types/Snackbar/snackbar-group.type';
|
|
@@ -12,7 +13,7 @@ import type { TSnackbarGroupDirection, TSnackbarGroupLocation } from '../../type
|
|
|
12
13
|
* The component subscribes to its registered stack `id` and re-renders
|
|
13
14
|
* when the underlying `items` ref changes.
|
|
14
15
|
*/
|
|
15
|
-
export interface ISnackbarGroupProps extends ICommonsComponentProps, ITagProps {
|
|
16
|
+
export interface ISnackbarGroupProps extends ICommonsComponentProps, ITagProps, IAttachProps {
|
|
16
17
|
/**
|
|
17
18
|
* Identifier of the stack this container renders. Pair with
|
|
18
19
|
* `useSnackbarGroup({ id })` to spawn items into the same stack.
|
|
@@ -520,6 +520,17 @@ Object.keys(_align).forEach(function (key) {
|
|
|
520
520
|
}
|
|
521
521
|
});
|
|
522
522
|
});
|
|
523
|
+
var _attach = require("./Commons/attach.interface.cjs");
|
|
524
|
+
Object.keys(_attach).forEach(function (key) {
|
|
525
|
+
if (key === "default" || key === "__esModule") return;
|
|
526
|
+
if (key in exports && exports[key] === _attach[key]) return;
|
|
527
|
+
Object.defineProperty(exports, key, {
|
|
528
|
+
enumerable: true,
|
|
529
|
+
get: function () {
|
|
530
|
+
return _attach[key];
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
});
|
|
523
534
|
var _audio = require("./Commons/audio.interface.cjs");
|
|
524
535
|
Object.keys(_audio).forEach(function (key) {
|
|
525
536
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -45,6 +45,7 @@ export * from './Commons/activator.interface';
|
|
|
45
45
|
export * from './Commons/active.interface';
|
|
46
46
|
export * from './Commons/adjacent.interface';
|
|
47
47
|
export * from './Commons/align.interface';
|
|
48
|
+
export * from './Commons/attach.interface';
|
|
48
49
|
export * from './Commons/audio.interface';
|
|
49
50
|
export * from './Commons/autocomplete.interface';
|
|
50
51
|
export * from './Commons/backdrop.interface';
|
|
@@ -45,6 +45,7 @@ export * from "./Commons/activator.interface.js";
|
|
|
45
45
|
export * from "./Commons/active.interface.js";
|
|
46
46
|
export * from "./Commons/adjacent.interface.js";
|
|
47
47
|
export * from "./Commons/align.interface.js";
|
|
48
|
+
export * from "./Commons/attach.interface.js";
|
|
48
49
|
export * from "./Commons/audio.interface.js";
|
|
49
50
|
export * from "./Commons/autocomplete.interface.js";
|
|
50
51
|
export * from "./Commons/backdrop.interface.js";
|
package/dist/src/origam.cjs
CHANGED
|
@@ -61,6 +61,7 @@ function createOrigam(origam = {}) {
|
|
|
61
61
|
const appScope = (0, _vue.effectScope)();
|
|
62
62
|
app.onUnmount(() => appScope.stop());
|
|
63
63
|
app.provide(_consts.ORIGAM_ICONS_KEY, icons);
|
|
64
|
+
app.provide(_consts.ORIGAM_CODE_KEY, options.code ?? {});
|
|
64
65
|
app.provide(_consts.ORIGAM_DISPLAY_KEY, display);
|
|
65
66
|
app.provide(_consts.ORIGAM_LOCALE_KEY, locale);
|
|
66
67
|
app.provide(_consts.ORIGAM_DATE_OPTIONS_KEY, date.options);
|
package/dist/src/origam.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from "./composables/index.js";
|
|
13
13
|
import {
|
|
14
14
|
IN_BROWSER,
|
|
15
|
+
ORIGAM_CODE_KEY,
|
|
15
16
|
ORIGAM_DATE_ADAPTER_KEY,
|
|
16
17
|
ORIGAM_DATE_OPTIONS_KEY,
|
|
17
18
|
ORIGAM_DEFAULTS_KEY,
|
|
@@ -79,6 +80,7 @@ export function createOrigam(origam = {}) {
|
|
|
79
80
|
const appScope = effectScope();
|
|
80
81
|
app.onUnmount(() => appScope.stop());
|
|
81
82
|
app.provide(ORIGAM_ICONS_KEY, icons);
|
|
83
|
+
app.provide(ORIGAM_CODE_KEY, options.code ?? {});
|
|
82
84
|
app.provide(ORIGAM_DISPLAY_KEY, display);
|
|
83
85
|
app.provide(ORIGAM_LOCALE_KEY, locale);
|
|
84
86
|
app.provide(ORIGAM_DATE_OPTIONS_KEY, date.options);
|
|
@@ -525,7 +525,16 @@ const origamDarkTheme = exports.origamDarkTheme = {
|
|
|
525
525
|
text: {
|
|
526
526
|
primary: "#fafafa",
|
|
527
527
|
secondary: "#a3a3a3",
|
|
528
|
-
|
|
528
|
+
/*********************************************************
|
|
529
|
+
* #1044 — tertiary corrigé
|
|
530
|
+
*
|
|
531
|
+
* @description
|
|
532
|
+
* Était '#737373' (neutral-500), copié du mode clair sans
|
|
533
|
+
* réadapter : 4.18:1 sur ce fond, sous AA (4.5:1). Aligné sur
|
|
534
|
+
* dark.css (neutral-400, 7.85:1) — voir sa note pour la
|
|
535
|
+
* mesure complète et pourquoi ce rung s'aplatit sur secondary.
|
|
536
|
+
********************************************************/
|
|
537
|
+
tertiary: "#a3a3a3",
|
|
529
538
|
disabled: "#525252",
|
|
530
539
|
inverse: "#0a0a0a",
|
|
531
540
|
onColor: "#ffffff",
|
|
@@ -253,7 +253,16 @@ export const origamDarkTheme = {
|
|
|
253
253
|
text: {
|
|
254
254
|
primary: "#fafafa",
|
|
255
255
|
secondary: "#a3a3a3",
|
|
256
|
-
|
|
256
|
+
/*********************************************************
|
|
257
|
+
* #1044 — tertiary corrigé
|
|
258
|
+
*
|
|
259
|
+
* @description
|
|
260
|
+
* Était '#737373' (neutral-500), copié du mode clair sans
|
|
261
|
+
* réadapter : 4.18:1 sur ce fond, sous AA (4.5:1). Aligné sur
|
|
262
|
+
* dark.css (neutral-400, 7.85:1) — voir sa note pour la
|
|
263
|
+
* mesure complète et pourquoi ce rung s'aplatit sur secondary.
|
|
264
|
+
********************************************************/
|
|
265
|
+
tertiary: "#a3a3a3",
|
|
257
266
|
disabled: "#525252",
|
|
258
267
|
inverse: "#0a0a0a",
|
|
259
268
|
onColor: "#ffffff",
|
|
@@ -22,3 +22,32 @@ export type TShikiHighlighter = {
|
|
|
22
22
|
defaultColor?: false | string;
|
|
23
23
|
}) => string;
|
|
24
24
|
};
|
|
25
|
+
/*********************************************************
|
|
26
|
+
* TShikiModule / TShikiHighlighterLoader
|
|
27
|
+
*
|
|
28
|
+
* @description
|
|
29
|
+
* `TShikiModule` is the slice of a shiki-COMPATIBLE MODULE that `useCode()`
|
|
30
|
+
* needs to build a highlighter — i.e. what `import('shiki')` (the DS's own
|
|
31
|
+
* default) or an app-supplied alternative must resolve to. Deliberately
|
|
32
|
+
* minimal, for the same reason `TShikiHighlighter` is: an app that wants to
|
|
33
|
+
* avoid shiki's WASM-loader chunk (see `code.composable.ts`'s
|
|
34
|
+
* `loadHighlighter()`) can hand `createOrigam({ code: { highlighter } })`
|
|
35
|
+
* a loader resolving to `shiki/core` + a regex engine — or any other
|
|
36
|
+
* module — as long as it exposes this one method. `shiki`'s own
|
|
37
|
+
* `createHighlighter` satisfies this type structurally; no cast needed on
|
|
38
|
+
* the consumer side.
|
|
39
|
+
*
|
|
40
|
+
* @description
|
|
41
|
+
* `TShikiHighlighterLoader` is the function shape an app passes as
|
|
42
|
+
* `createOrigam({ code: { highlighter } })` to supply that module instead
|
|
43
|
+
* of the DS's default `import('shiki')`. See `code.composable.ts`'s
|
|
44
|
+
* `loadHighlighter()` for how this branches the dynamic-import path, and
|
|
45
|
+
* `ICodeOptions` for the option itself.
|
|
46
|
+
********************************************************/
|
|
47
|
+
export type TShikiModule = {
|
|
48
|
+
createHighlighter: (opts: {
|
|
49
|
+
themes: ReadonlyArray<string>;
|
|
50
|
+
langs: ReadonlyArray<string>;
|
|
51
|
+
}) => Promise<TShikiHighlighter>;
|
|
52
|
+
};
|
|
53
|
+
export type TShikiHighlighterLoader = () => Promise<TShikiModule>;
|