@syware/jlib 0.1.0 → 0.2.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/README.md +8 -6
- package/dist/all.js +4 -3
- package/dist/atoms/jl-icon.css_raw.js +1 -1
- package/dist/atoms/jl-icon.d.ts +7 -1
- package/dist/atoms/jl-icon.js +4 -1
- package/dist/atoms/jl-progress-ring.js +1 -6
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -2
- package/dist/lib/calendar.d.ts +15 -1
- package/dist/lib/calendar.js +72 -1
- package/dist/lib/dom.d.ts +2 -0
- package/dist/lib/dom.js +8 -1
- package/dist/lib/flow.d.ts +61 -0
- package/dist/lib/flow.js +336 -0
- package/dist/lib/options.d.ts +5 -0
- package/dist/lib/options.js +13 -1
- package/dist/molecules/jl-alert.d.ts +1 -0
- package/dist/molecules/jl-alert.js +3 -1
- package/dist/molecules/jl-date-picker.d.ts +10 -4
- package/dist/molecules/jl-date-picker.js +21 -8
- package/dist/molecules/jl-steps.css_raw.js +1 -1
- package/dist/molecules/jl-timeline.css_raw.js +1 -1
- package/dist/molecules/jl-timeline.d.ts +2 -1
- package/dist/molecules/jl-timeline.js +18 -16
- package/dist/molecules/jl-toast.css_raw.js +1 -1
- package/dist/molecules/jl-toast.d.ts +1 -0
- package/dist/molecules/jl-toast.js +3 -1
- package/dist/organisms/jl-flow.css_raw.js +3 -0
- package/dist/organisms/jl-flow.d.ts +86 -0
- package/dist/organisms/jl-flow.js +650 -0
- package/dist/types/calendar.types.d.ts +2 -0
- package/dist/types/jl-flow.types.d.ts +77 -0
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -97,14 +97,16 @@ component. Conventions for contributors are in [CLAUDE.md](CLAUDE.md).
|
|
|
97
97
|
|
|
98
98
|
## Releasing
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
npm
|
|
100
|
+
```bash
|
|
101
|
+
npm version patch
|
|
102
|
+
```
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
```bash
|
|
105
|
+
git push --follow-tags
|
|
106
|
+
```
|
|
106
107
|
|
|
107
|
-
The
|
|
108
|
+
The tag stages the version on npm and creates the GitHub release; a maintainer then approves it with
|
|
109
|
+
`npm stage approve`. Every step, pre-releases and what to do when something fails: [RELEASING.md](RELEASING.md).
|
|
108
110
|
|
|
109
111
|
## Made by SyWare
|
|
110
112
|
|
package/dist/all.js
CHANGED
|
@@ -7,7 +7,7 @@ import { define } from "./lib/define.js";
|
|
|
7
7
|
import { PLACEMENTS, computePosition, followAnchor, placeFloating } from "./lib/floating.js";
|
|
8
8
|
import { COMMON_ICONS } from "./lib/icon-set.js";
|
|
9
9
|
import { hasIcon, iconElement, iconNames, registerIcons } from "./lib/icons.js";
|
|
10
|
-
import { CONTROL_SIZES, TONES, TONE_ICONS } from "./lib/options.js";
|
|
10
|
+
import { CONTROL_SIZES, TONES, TONE_ICONS, TONE_ICON_FILLED } from "./lib/options.js";
|
|
11
11
|
import { JlIcon } from "./atoms/jl-icon.js";
|
|
12
12
|
import { AVATAR_SHAPES, AVATAR_SIZES, AVATAR_STATUSES, JlAvatar } from "./atoms/jl-avatar.js";
|
|
13
13
|
import { JlBadge } from "./atoms/jl-badge.js";
|
|
@@ -61,6 +61,7 @@ import { JlCommandPalette } from "./organisms/jl-command-palette.js";
|
|
|
61
61
|
import { DIALOG_SIZES, JlDialog } from "./organisms/jl-dialog.js";
|
|
62
62
|
import { CONFIRM_TONES, JlConfirm, confirmDialog } from "./organisms/jl-confirm.js";
|
|
63
63
|
import { DRAWER_PLACEMENTS, DRAWER_SIZES, JlDrawer } from "./organisms/jl-drawer.js";
|
|
64
|
+
import { JlFlow } from "./organisms/jl-flow.js";
|
|
64
65
|
import { JlNavbar } from "./organisms/jl-navbar.js";
|
|
65
66
|
import { JlPageHeader } from "./organisms/jl-page-header.js";
|
|
66
67
|
import { JlSideNav } from "./organisms/jl-side-nav.js";
|
|
@@ -71,5 +72,5 @@ import { JlAppShell } from "./templates/jl-app-shell.js";
|
|
|
71
72
|
import { JlSplitView, SPLIT_ORIENTATIONS } from "./templates/jl-split-view.js";
|
|
72
73
|
// src/all.ts
|
|
73
74
|
registerIcons(COMMON_ICONS);
|
|
74
|
-
define(JlAccordion, JlAccordionItem, JlAlert, JlAppShell, JlAvatar, JlAvatarGroup, JlBadge, JlBreadcrumb, JlButton, JlCalendar, JlCard, JlCheckbox, JlChip, JlCodeBlock, JlCombobox, JlCommandPalette, JlConfirm, JlCopyButton, JlDatePicker, JlDialog, JlDivider, JlDrawer, JlEmpty, JlField, JlFileDrop, JlIcon, JlInput, JlKbd, JlLink, JlListItem, JlMenu, JlNavbar, JlNumberInput, JlPageHeader, JlPagination, JlPopover, JlProgress, JlProgressRing, JlRadioGroup, JlRating, JlSearch, JlSegmented, JlSelect, JlSideNav, JlSkeleton, JlSlider, JlSpinner, JlSplitView, JlStat, JlSteps, JlSwitch, JlTable, JlTabPanel, JlTabs, JlTagInput, JlTextarea, JlTimeline, JlToast, JlToaster, JlTooltip, JlTree);
|
|
75
|
-
export { ACCORDION_VARIANTS, AVATAR_SHAPES, AVATAR_SIZES, AVATAR_STATUSES, BUTTON_TYPES, BUTTON_VARIANTS, CARD_PADDINGS, CHIP_SIZES, CODE_LANGUAGES, COMMON_ICONS, CONFIRM_TONES, CONTROL_SIZES, DIALOG_SIZES, DIVIDER_ALIGNS, DRAWER_PLACEMENTS, DRAWER_SIZES, EMPTY_SIZES, FIELD_ORIENTATIONS, INPUT_TYPES, JlAccordion, JlAccordionItem, JlAlert, JlAppShell, JlAvatar, JlAvatarGroup, JlBadge, JlBreadcrumb, JlButton, JlCalendar, JlCard, JlCheckbox, JlChip, JlCodeBlock, JlCombobox, JlCommandPalette, JlConfirm, JlCopyButton, JlDatePicker, JlDialog, JlDivider, JlDrawer, JlElement, JlEmpty, JlField, JlFileDrop, JlFormControl, JlIcon, JlInput, JlKbd, JlLink, JlListItem, JlMenu, JlNavbar, JlNumberInput, JlPageHeader, JlPagination, JlPopover, JlProgress, JlProgressRing, JlRadioGroup, JlRating, JlSearch, JlSegmented, JlSelect, JlSideNav, JlSkeleton, JlSlider, JlSpinner, JlSplitView, JlStat, JlSteps, JlSwitch, JlTabPanel, JlTable, JlTabs, JlTagInput, JlTextarea, JlTimeline, JlToast, JlToaster, JlTooltip, JlTree, LINK_VARIANTS, PLACEMENTS, PROGRESS_SIZES, PROGRESS_TONES, RADIO_GROUP_ORIENTATIONS, RADIO_GROUP_VARIANTS, SKELETON_SHAPES, SPLIT_ORIENTATIONS, STAT_TRENDS, STEPS_ORIENTATIONS, SWITCH_SIZES, TABLE_SORT_DIRECTIONS, TAB_VARIANTS, TOASTER_PLACEMENTS, TOAST_TONES, TOKEN_STYLES, TONES, TONE_ICONS, adoptTokens, clampedNumber, computePosition, confirmDialog, define, followAnchor, hasIcon, iconElement, iconNames, jsonOf, oneOf, placeFloating, registerIcons, toast };
|
|
75
|
+
define(JlAccordion, JlAccordionItem, JlAlert, JlAppShell, JlAvatar, JlAvatarGroup, JlBadge, JlBreadcrumb, JlButton, JlCalendar, JlCard, JlCheckbox, JlChip, JlCodeBlock, JlCombobox, JlCommandPalette, JlConfirm, JlCopyButton, JlDatePicker, JlDialog, JlDivider, JlDrawer, JlEmpty, JlField, JlFileDrop, JlFlow, JlIcon, JlInput, JlKbd, JlLink, JlListItem, JlMenu, JlNavbar, JlNumberInput, JlPageHeader, JlPagination, JlPopover, JlProgress, JlProgressRing, JlRadioGroup, JlRating, JlSearch, JlSegmented, JlSelect, JlSideNav, JlSkeleton, JlSlider, JlSpinner, JlSplitView, JlStat, JlSteps, JlSwitch, JlTable, JlTabPanel, JlTabs, JlTagInput, JlTextarea, JlTimeline, JlToast, JlToaster, JlTooltip, JlTree);
|
|
76
|
+
export { ACCORDION_VARIANTS, AVATAR_SHAPES, AVATAR_SIZES, AVATAR_STATUSES, BUTTON_TYPES, BUTTON_VARIANTS, CARD_PADDINGS, CHIP_SIZES, CODE_LANGUAGES, COMMON_ICONS, CONFIRM_TONES, CONTROL_SIZES, DIALOG_SIZES, DIVIDER_ALIGNS, DRAWER_PLACEMENTS, DRAWER_SIZES, EMPTY_SIZES, FIELD_ORIENTATIONS, INPUT_TYPES, JlAccordion, JlAccordionItem, JlAlert, JlAppShell, JlAvatar, JlAvatarGroup, JlBadge, JlBreadcrumb, JlButton, JlCalendar, JlCard, JlCheckbox, JlChip, JlCodeBlock, JlCombobox, JlCommandPalette, JlConfirm, JlCopyButton, JlDatePicker, JlDialog, JlDivider, JlDrawer, JlElement, JlEmpty, JlField, JlFileDrop, JlFlow, JlFormControl, JlIcon, JlInput, JlKbd, JlLink, JlListItem, JlMenu, JlNavbar, JlNumberInput, JlPageHeader, JlPagination, JlPopover, JlProgress, JlProgressRing, JlRadioGroup, JlRating, JlSearch, JlSegmented, JlSelect, JlSideNav, JlSkeleton, JlSlider, JlSpinner, JlSplitView, JlStat, JlSteps, JlSwitch, JlTabPanel, JlTable, JlTabs, JlTagInput, JlTextarea, JlTimeline, JlToast, JlToaster, JlTooltip, JlTree, LINK_VARIANTS, PLACEMENTS, PROGRESS_SIZES, PROGRESS_TONES, RADIO_GROUP_ORIENTATIONS, RADIO_GROUP_VARIANTS, SKELETON_SHAPES, SPLIT_ORIENTATIONS, STAT_TRENDS, STEPS_ORIENTATIONS, SWITCH_SIZES, TABLE_SORT_DIRECTIONS, TAB_VARIANTS, TOASTER_PLACEMENTS, TOAST_TONES, TOKEN_STYLES, TONES, TONE_ICONS, TONE_ICON_FILLED, adoptTokens, clampedNumber, computePosition, confirmDialog, define, followAnchor, hasIcon, iconElement, iconNames, jsonOf, oneOf, placeFloating, registerIcons, toast };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/atoms/jl-icon.css?raw
|
|
2
|
-
var jl_icon_default = ":host {\n display: inline-flex;\n flex: none;\n line-height: 0;\n vertical-align: middle;\n}\n\n.icon {\n display: inline-flex;\n}\n";
|
|
2
|
+
var jl_icon_default = ":host {\n --cutout: var(--jl-surface);\n display: inline-flex;\n flex: none;\n line-height: 0;\n vertical-align: middle;\n}\n\n.icon {\n display: inline-flex;\n}\n\n/* Filled: lucide draws the shape around a sign first (the circle of circle-check, the triangle of triangle-alert).\n It takes the colour, and the sign takes the background's, as if cut out of it. */\n:host([filled]) svg > :first-child {\n fill: currentColor;\n}\n\n:host([filled]) svg > :not(:first-child) {\n stroke: var(--cutout);\n}\n";
|
|
3
3
|
export { jl_icon_default as default };
|
package/dist/atoms/jl-icon.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { JlElement } from '../base/jl-element';
|
|
2
2
|
/**
|
|
3
3
|
* A lucide icon by name: `<jl-icon name="search">`. Decorative unless it has a `label`, which screen readers
|
|
4
|
-
* read instead. More icons: `registerIcons({ rocket: Rocket })`.
|
|
4
|
+
* read instead. More icons: `registerIcons({ rocket: Rocket })`. `filled` draws a sign in a shape (`circle-check`,
|
|
5
|
+
* `triangle-alert`) as a solid badge.
|
|
5
6
|
*/
|
|
6
7
|
export declare class JlIcon extends JlElement {
|
|
7
8
|
static readonly selector = "jl-icon";
|
|
@@ -17,6 +18,11 @@ export declare class JlIcon extends JlElement {
|
|
|
17
18
|
get(): string;
|
|
18
19
|
set(setter: string | ((prevState: string) => string)): void;
|
|
19
20
|
}>>;
|
|
21
|
+
/** The icon's first shape (the circle or triangle around a sign) in solid colour, the sign cut out of it. */
|
|
22
|
+
readonly filled: Readonly<Readonly<{
|
|
23
|
+
get(): boolean;
|
|
24
|
+
set(setter: boolean | ((prevState: boolean) => boolean)): void;
|
|
25
|
+
}>>;
|
|
20
26
|
private readonly _refs;
|
|
21
27
|
templateHtml(): Node;
|
|
22
28
|
templateCss(): string;
|
package/dist/atoms/jl-icon.js
CHANGED
|
@@ -8,13 +8,16 @@ import { jsx } from "@jadis/core/jsx-runtime";
|
|
|
8
8
|
var DEFAULT_SIZE = 16;
|
|
9
9
|
/**
|
|
10
10
|
* A lucide icon by name: `<jl-icon name="search">`. Decorative unless it has a `label`, which screen readers
|
|
11
|
-
* read instead. More icons: `registerIcons({ rocket: Rocket })`.
|
|
11
|
+
* read instead. More icons: `registerIcons({ rocket: Rocket })`. `filled` draws a sign in a shape (`circle-check`,
|
|
12
|
+
* `triangle-alert`) as a solid badge.
|
|
12
13
|
*/
|
|
13
14
|
var JlIcon = class extends JlElement {
|
|
14
15
|
static selector = "jl-icon";
|
|
15
16
|
name = this.useChange("", () => this.draw(), { attribute: "name" });
|
|
16
17
|
size = this.useChange(DEFAULT_SIZE, () => this.draw(), { attribute: "size" });
|
|
17
18
|
label = this.useChange("", (value) => this.setAccessibleName(value), { attribute: "label" });
|
|
19
|
+
/** The icon's first shape (the circle or triangle around a sign) in solid colour, the sign cut out of it. */
|
|
20
|
+
filled = this.useChange(false, (value) => this.reflect("filled", value), { attribute: "filled" });
|
|
18
21
|
_refs = this.useRefs((ref) => ({ icon: ref(".icon") }));
|
|
19
22
|
templateHtml() {
|
|
20
23
|
return /* @__PURE__ */ jsx("span", { class: "icon" });
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { BASE_STYLES } from "../styles/shared.js";
|
|
2
2
|
import { JlElement } from "../base/jl-element.js";
|
|
3
3
|
import { oneOf } from "../lib/attributes.js";
|
|
4
|
+
import { svgElement } from "../lib/dom.js";
|
|
4
5
|
import { optionalNumber, percentLabel, percentOf, progressRatio, ringGeometry } from "../lib/progress.js";
|
|
5
6
|
import { PROGRESS_TONES } from "./jl-progress.js";
|
|
6
7
|
import jl_progress_ring_default from "./jl-progress-ring.css_raw.js";
|
|
7
8
|
import { css } from "@jadis/core";
|
|
8
9
|
import { jsx } from "@jadis/core/jsx-runtime";
|
|
9
10
|
// src/atoms/jl-progress-ring.tsx
|
|
10
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
11
11
|
var DEFAULT_MAX = 100;
|
|
12
12
|
var DEFAULT_SIZE = 40;
|
|
13
13
|
var DEFAULT_THICKNESS = 4;
|
|
14
14
|
var PATH_LENGTH = 100;
|
|
15
15
|
var DEFAULT_NAME = "Progress";
|
|
16
|
-
function svgElement(tag, attributes) {
|
|
17
|
-
const element = document.createElementNS(SVG_NS, tag);
|
|
18
|
-
for (const [name, value] of Object.entries(attributes)) element.setAttribute(name, value);
|
|
19
|
-
return element;
|
|
20
|
-
}
|
|
21
16
|
/**
|
|
22
17
|
* How far a task has gone, as a ring: `value` out of `max`, the percentage in its centre with `show-value`.
|
|
23
18
|
* Without a value, the ring turns: the work has no known end. Fits in buttons, cards and table cells.
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { define } from './lib/define';
|
|
|
5
5
|
export { computePosition, followAnchor, PLACEMENTS, placeFloating } from './lib/floating';
|
|
6
6
|
export { COMMON_ICONS } from './lib/icon-set';
|
|
7
7
|
export { hasIcon, iconElement, iconNames, registerIcons } from './lib/icons';
|
|
8
|
-
export { CONTROL_SIZES, TONE_ICONS, TONES } from './lib/options';
|
|
8
|
+
export { CONTROL_SIZES, TONE_ICON_FILLED, TONE_ICONS, TONES } from './lib/options';
|
|
9
9
|
export { adoptTokens } from './lib/tokens';
|
|
10
10
|
export { TOKEN_STYLES } from './styles/shared';
|
|
11
11
|
export type * from './types/calendar.types';
|
|
@@ -28,6 +28,7 @@ export type * from './types/jl-divider.types';
|
|
|
28
28
|
export type * from './types/jl-drawer.types';
|
|
29
29
|
export type * from './types/jl-empty.types';
|
|
30
30
|
export type * from './types/jl-field.types';
|
|
31
|
+
export type * from './types/jl-flow.types';
|
|
31
32
|
export type * from './types/jl-input.types';
|
|
32
33
|
export type * from './types/jl-link.types';
|
|
33
34
|
export type * from './types/jl-menu.types';
|
|
@@ -109,6 +110,7 @@ export * from './organisms/jl-command-palette';
|
|
|
109
110
|
export * from './organisms/jl-confirm';
|
|
110
111
|
export * from './organisms/jl-dialog';
|
|
111
112
|
export * from './organisms/jl-drawer';
|
|
113
|
+
export * from './organisms/jl-flow';
|
|
112
114
|
export * from './organisms/jl-navbar';
|
|
113
115
|
export * from './organisms/jl-page-header';
|
|
114
116
|
export * from './organisms/jl-side-nav';
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { define } from "./lib/define.js";
|
|
|
7
7
|
import { PLACEMENTS, computePosition, followAnchor, placeFloating } from "./lib/floating.js";
|
|
8
8
|
import { COMMON_ICONS } from "./lib/icon-set.js";
|
|
9
9
|
import { hasIcon, iconElement, iconNames, registerIcons } from "./lib/icons.js";
|
|
10
|
-
import { CONTROL_SIZES, TONES, TONE_ICONS } from "./lib/options.js";
|
|
10
|
+
import { CONTROL_SIZES, TONES, TONE_ICONS, TONE_ICON_FILLED } from "./lib/options.js";
|
|
11
11
|
import { JlIcon } from "./atoms/jl-icon.js";
|
|
12
12
|
import { AVATAR_SHAPES, AVATAR_SIZES, AVATAR_STATUSES, JlAvatar } from "./atoms/jl-avatar.js";
|
|
13
13
|
import { JlBadge } from "./atoms/jl-badge.js";
|
|
@@ -61,6 +61,7 @@ import { JlCommandPalette } from "./organisms/jl-command-palette.js";
|
|
|
61
61
|
import { DIALOG_SIZES, JlDialog } from "./organisms/jl-dialog.js";
|
|
62
62
|
import { CONFIRM_TONES, JlConfirm, confirmDialog } from "./organisms/jl-confirm.js";
|
|
63
63
|
import { DRAWER_PLACEMENTS, DRAWER_SIZES, JlDrawer } from "./organisms/jl-drawer.js";
|
|
64
|
+
import { JlFlow } from "./organisms/jl-flow.js";
|
|
64
65
|
import { JlNavbar } from "./organisms/jl-navbar.js";
|
|
65
66
|
import { JlPageHeader } from "./organisms/jl-page-header.js";
|
|
66
67
|
import { JlSideNav } from "./organisms/jl-side-nav.js";
|
|
@@ -69,4 +70,4 @@ import { JlToaster, TOASTER_PLACEMENTS, toast } from "./organisms/jl-toaster.js"
|
|
|
69
70
|
import { JlTree } from "./organisms/jl-tree.js";
|
|
70
71
|
import { JlAppShell } from "./templates/jl-app-shell.js";
|
|
71
72
|
import { JlSplitView, SPLIT_ORIENTATIONS } from "./templates/jl-split-view.js";
|
|
72
|
-
export { ACCORDION_VARIANTS, AVATAR_SHAPES, AVATAR_SIZES, AVATAR_STATUSES, BUTTON_TYPES, BUTTON_VARIANTS, CARD_PADDINGS, CHIP_SIZES, CODE_LANGUAGES, COMMON_ICONS, CONFIRM_TONES, CONTROL_SIZES, DIALOG_SIZES, DIVIDER_ALIGNS, DRAWER_PLACEMENTS, DRAWER_SIZES, EMPTY_SIZES, FIELD_ORIENTATIONS, INPUT_TYPES, JlAccordion, JlAccordionItem, JlAlert, JlAppShell, JlAvatar, JlAvatarGroup, JlBadge, JlBreadcrumb, JlButton, JlCalendar, JlCard, JlCheckbox, JlChip, JlCodeBlock, JlCombobox, JlCommandPalette, JlConfirm, JlCopyButton, JlDatePicker, JlDialog, JlDivider, JlDrawer, JlElement, JlEmpty, JlField, JlFileDrop, JlFormControl, JlIcon, JlInput, JlKbd, JlLink, JlListItem, JlMenu, JlNavbar, JlNumberInput, JlPageHeader, JlPagination, JlPopover, JlProgress, JlProgressRing, JlRadioGroup, JlRating, JlSearch, JlSegmented, JlSelect, JlSideNav, JlSkeleton, JlSlider, JlSpinner, JlSplitView, JlStat, JlSteps, JlSwitch, JlTabPanel, JlTable, JlTabs, JlTagInput, JlTextarea, JlTimeline, JlToast, JlToaster, JlTooltip, JlTree, LINK_VARIANTS, PLACEMENTS, PROGRESS_SIZES, PROGRESS_TONES, RADIO_GROUP_ORIENTATIONS, RADIO_GROUP_VARIANTS, SKELETON_SHAPES, SPLIT_ORIENTATIONS, STAT_TRENDS, STEPS_ORIENTATIONS, SWITCH_SIZES, TABLE_SORT_DIRECTIONS, TAB_VARIANTS, TOASTER_PLACEMENTS, TOAST_TONES, TOKEN_STYLES, TONES, TONE_ICONS, adoptTokens, clampedNumber, computePosition, confirmDialog, define, followAnchor, hasIcon, iconElement, iconNames, jsonOf, oneOf, placeFloating, registerIcons, toast };
|
|
73
|
+
export { ACCORDION_VARIANTS, AVATAR_SHAPES, AVATAR_SIZES, AVATAR_STATUSES, BUTTON_TYPES, BUTTON_VARIANTS, CARD_PADDINGS, CHIP_SIZES, CODE_LANGUAGES, COMMON_ICONS, CONFIRM_TONES, CONTROL_SIZES, DIALOG_SIZES, DIVIDER_ALIGNS, DRAWER_PLACEMENTS, DRAWER_SIZES, EMPTY_SIZES, FIELD_ORIENTATIONS, INPUT_TYPES, JlAccordion, JlAccordionItem, JlAlert, JlAppShell, JlAvatar, JlAvatarGroup, JlBadge, JlBreadcrumb, JlButton, JlCalendar, JlCard, JlCheckbox, JlChip, JlCodeBlock, JlCombobox, JlCommandPalette, JlConfirm, JlCopyButton, JlDatePicker, JlDialog, JlDivider, JlDrawer, JlElement, JlEmpty, JlField, JlFileDrop, JlFlow, JlFormControl, JlIcon, JlInput, JlKbd, JlLink, JlListItem, JlMenu, JlNavbar, JlNumberInput, JlPageHeader, JlPagination, JlPopover, JlProgress, JlProgressRing, JlRadioGroup, JlRating, JlSearch, JlSegmented, JlSelect, JlSideNav, JlSkeleton, JlSlider, JlSpinner, JlSplitView, JlStat, JlSteps, JlSwitch, JlTabPanel, JlTable, JlTabs, JlTagInput, JlTextarea, JlTimeline, JlToast, JlToaster, JlTooltip, JlTree, LINK_VARIANTS, PLACEMENTS, PROGRESS_SIZES, PROGRESS_TONES, RADIO_GROUP_ORIENTATIONS, RADIO_GROUP_VARIANTS, SKELETON_SHAPES, SPLIT_ORIENTATIONS, STAT_TRENDS, STEPS_ORIENTATIONS, SWITCH_SIZES, TABLE_SORT_DIRECTIONS, TAB_VARIANTS, TOASTER_PLACEMENTS, TOAST_TONES, TOKEN_STYLES, TONES, TONE_ICONS, TONE_ICON_FILLED, adoptTokens, clampedNumber, computePosition, confirmDialog, define, followAnchor, hasIcon, iconElement, iconNames, jsonOf, oneOf, placeFloating, registerIcons, toast };
|
package/dist/lib/calendar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CalendarDate, Weekday, WeekdayWidth } from '../types/calendar.types';
|
|
1
|
+
import type { CalendarDate, DatePart, Weekday, WeekdayWidth } from '../types/calendar.types';
|
|
2
2
|
/** A month grid always has six weeks, so the calendar keeps its height from one month to the next. */
|
|
3
3
|
export declare const WEEKS_PER_GRID = 6;
|
|
4
4
|
export declare const isLeapYear: (year: number) => boolean;
|
|
@@ -46,3 +46,17 @@ export declare const formatDate: (date: CalendarDate, locale: string | undefined
|
|
|
46
46
|
export declare const formatMonthTitle: (year: number, month: number, locale: string | undefined) => string;
|
|
47
47
|
/** The names of the weekdays, in the order a week shows them from its first day. */
|
|
48
48
|
export declare const weekdayNames: (locale: string | undefined, firstDay: Weekday, width: WeekdayWidth) => string[];
|
|
49
|
+
/** How a date field writes a date: in digits, in the locale's order, the year in full (`25.10.2026`, `10/25/2026`). */
|
|
50
|
+
export declare const NUMERIC_DATE: Intl.DateTimeFormatOptions;
|
|
51
|
+
/** The order a locale writes the day, the month and the year in: `['day', 'month', 'year']` in French. */
|
|
52
|
+
export declare const dateOrder: (locale: string | undefined) => DatePart[];
|
|
53
|
+
/** How a date is typed in a locale, for a placeholder: `dd.mm.yyyy`, `mm/dd/yyyy`. */
|
|
54
|
+
export declare const datePattern: (locale: string | undefined) => string;
|
|
55
|
+
/** Whether text could be part of a typed date: digits and separators, no letters. */
|
|
56
|
+
export declare const isDateText: (text: string) => boolean;
|
|
57
|
+
/**
|
|
58
|
+
* A date as people type it in a field: in the locale's order with any separators (`25.10.2026`, `25/10/2026`), its
|
|
59
|
+
* digits alone (`25102026`), or year first (`2026-10-25`, `2026/10/25`). Null for anything else, including days that
|
|
60
|
+
* do not exist.
|
|
61
|
+
*/
|
|
62
|
+
export declare function parseTypedDate(text: string, order: readonly DatePart[]): CalendarDate | null;
|
package/dist/lib/calendar.js
CHANGED
|
@@ -163,4 +163,75 @@ var formatMonthTitle = (year, month, locale) => formatDate({
|
|
|
163
163
|
});
|
|
164
164
|
/** The names of the weekdays, in the order a week shows them from its first day. */
|
|
165
165
|
var weekdayNames = (locale, firstDay, width) => weekdayOrder(firstDay).map((weekday) => formatDate(addDays(A_SUNDAY, weekday), locale, { weekday: width }));
|
|
166
|
-
|
|
166
|
+
/** How a date field writes a date: in digits, in the locale's order, the year in full (`25.10.2026`, `10/25/2026`). */
|
|
167
|
+
var NUMERIC_DATE = {
|
|
168
|
+
day: "2-digit",
|
|
169
|
+
month: "2-digit",
|
|
170
|
+
numberingSystem: "latn",
|
|
171
|
+
year: "numeric"
|
|
172
|
+
};
|
|
173
|
+
var DATE_PARTS = [
|
|
174
|
+
"day",
|
|
175
|
+
"month",
|
|
176
|
+
"year"
|
|
177
|
+
];
|
|
178
|
+
var ISO_ORDER = [
|
|
179
|
+
"year",
|
|
180
|
+
"month",
|
|
181
|
+
"day"
|
|
182
|
+
];
|
|
183
|
+
var PATTERN_LETTERS = {
|
|
184
|
+
day: "dd",
|
|
185
|
+
month: "mm",
|
|
186
|
+
year: "yyyy"
|
|
187
|
+
};
|
|
188
|
+
var PART_DIGITS = {
|
|
189
|
+
day: 2,
|
|
190
|
+
month: 2,
|
|
191
|
+
year: 4
|
|
192
|
+
};
|
|
193
|
+
var DATE_TEXT = /^[\d\s./,-]*$/;
|
|
194
|
+
var NOT_DIGITS = /\D+/;
|
|
195
|
+
var isDatePart = (type) => DATE_PARTS.some((part) => part === type);
|
|
196
|
+
/** A date written in digits in a locale, cut in its parts: `25`, `.`, `10`, `.`, `2026`. */
|
|
197
|
+
var numericParts = (locale) => new Intl.DateTimeFormat(locale, {
|
|
198
|
+
...NUMERIC_DATE,
|
|
199
|
+
timeZone: UTC
|
|
200
|
+
}).formatToParts(new Date(utcTime(A_SUNDAY)));
|
|
201
|
+
/** The order a locale writes the day, the month and the year in: `['day', 'month', 'year']` in French. */
|
|
202
|
+
var dateOrder = (locale) => numericParts(locale).flatMap((part) => isDatePart(part.type) ? [part.type] : []);
|
|
203
|
+
/** How a date is typed in a locale, for a placeholder: `dd.mm.yyyy`, `mm/dd/yyyy`. */
|
|
204
|
+
var datePattern = (locale) => numericParts(locale).map((part) => isDatePart(part.type) ? PATTERN_LETTERS[part.type] : part.value).join("");
|
|
205
|
+
/** Whether text could be part of a typed date: digits and separators, no letters. */
|
|
206
|
+
var isDateText = (text) => DATE_TEXT.test(text);
|
|
207
|
+
/** Digits typed without separators, cut in the locale's parts; null when there are not as many as a date has. */
|
|
208
|
+
function splitDigits(digits, order) {
|
|
209
|
+
const lengths = order.map((part) => PART_DIGITS[part]);
|
|
210
|
+
if (digits.length !== lengths.reduce((sum, length) => sum + length, 0)) return null;
|
|
211
|
+
return lengths.map((length, index) => {
|
|
212
|
+
const start = lengths.slice(0, index).reduce((sum, before) => sum + before, 0);
|
|
213
|
+
return digits.slice(start, start + length);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
/** The typed groups of digits, as many as the date has parts; null otherwise. */
|
|
217
|
+
function typedGroups(text, order) {
|
|
218
|
+
const groups = text.split(NOT_DIGITS).filter((group) => group !== "");
|
|
219
|
+
const parts = groups.length === 1 ? splitDigits(groups[0] ?? "", order) : groups;
|
|
220
|
+
return parts !== null && parts.length === order.length ? parts : null;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* A date as people type it in a field: in the locale's order with any separators (`25.10.2026`, `25/10/2026`), its
|
|
224
|
+
* digits alone (`25102026`), or year first (`2026-10-25`, `2026/10/25`). Null for anything else, including days that
|
|
225
|
+
* do not exist.
|
|
226
|
+
*/
|
|
227
|
+
function parseTypedDate(text, order) {
|
|
228
|
+
const trimmed = text.trim();
|
|
229
|
+
const groups = isDateText(trimmed) ? typedGroups(trimmed, order) : null;
|
|
230
|
+
if (groups === null) return null;
|
|
231
|
+
const used = groups[0]?.length === YEAR_DIGITS ? ISO_ORDER : order;
|
|
232
|
+
const part = (name) => groups[used.indexOf(name)] ?? "";
|
|
233
|
+
if (!DATE_PARTS.every((name) => name === "year" ? part(name).length === PART_DIGITS.year : part(name).length <= PART_DIGITS[name])) return null;
|
|
234
|
+
const digits = (name) => pad(Number(part(name)), PART_DIGITS[name]);
|
|
235
|
+
return parseIsoDate(`${digits("year")}-${digits("month")}-${digits("day")}`);
|
|
236
|
+
}
|
|
237
|
+
export { NUMERIC_DATE, addDays, addMonths, addYears, calendarDateOf, clampDate, compareDates, dateAfterKey, dateFormatter, dateOrder, datePattern, dayOfWeek, daysInMonth, endOfWeek, formatDate, formatMonthTitle, isDateText, isLeapYear, isSameDate, isSameMonth, isWithin, monthGrid, monthHasDaysWithin, parseIsoDate, parseTypedDate, startOfWeek, toIsoDate, weekdayNames, weekdayOrder };
|
package/dist/lib/dom.d.ts
CHANGED
|
@@ -2,3 +2,5 @@
|
|
|
2
2
|
export declare function setOrRemove(element: Element, name: string, value: string): void;
|
|
3
3
|
/** A unique id within the page, for wiring `aria-controls`, `aria-labelledby` and the like inside a shadow root. */
|
|
4
4
|
export declare function uniqueId(prefix: string): string;
|
|
5
|
+
/** An SVG element with its attributes: JSX makes HTML elements only. */
|
|
6
|
+
export declare function svgElement<Tag extends keyof SVGElementTagNameMap>(tag: Tag, attributes: Record<string, string>): SVGElementTagNameMap[Tag];
|
package/dist/lib/dom.js
CHANGED
|
@@ -13,4 +13,11 @@ function uniqueId(prefix) {
|
|
|
13
13
|
sequence.next += 1;
|
|
14
14
|
return `${prefix}-${sequence.next}`;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
17
|
+
/** An SVG element with its attributes: JSX makes HTML elements only. */
|
|
18
|
+
function svgElement(tag, attributes) {
|
|
19
|
+
const element = document.createElementNS(SVG_NS, tag);
|
|
20
|
+
for (const [name, value] of Object.entries(attributes)) element.setAttribute(name, value);
|
|
21
|
+
return element;
|
|
22
|
+
}
|
|
23
|
+
export { setOrRemove, svgElement, uniqueId };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { FlowEdge, FlowEdgeEnds, FlowGraph, FlowNode, FlowPoint, FlowPort, FlowViewport } from '../types/jl-flow.types';
|
|
2
|
+
/** A node's box: fixed, so that every anchor and edge is computed without measuring the page. */
|
|
3
|
+
export declare const FLOW_NODE: {
|
|
4
|
+
readonly height: 64;
|
|
5
|
+
readonly width: 240;
|
|
6
|
+
};
|
|
7
|
+
export declare const FLOW_ZOOM: {
|
|
8
|
+
readonly max: 2;
|
|
9
|
+
readonly min: 0.25;
|
|
10
|
+
readonly step: 1.2;
|
|
11
|
+
};
|
|
12
|
+
/** The exit of a node that names none. */
|
|
13
|
+
export declare const DEFAULT_PORT: FlowPort;
|
|
14
|
+
export declare const portsOf: (node: FlowNode) => FlowPort[];
|
|
15
|
+
/** The exit an edge leaves by: its own, or its node's first. */
|
|
16
|
+
export declare const portOfEdge: (node: FlowNode, edge: FlowEdge) => string;
|
|
17
|
+
export declare const snap: (point: FlowPoint) => FlowPoint;
|
|
18
|
+
/** Where a node's n-th exit sits along its bottom edge: the edge cut in equal parts, each exit in the middle of one. */
|
|
19
|
+
export declare const portX: (index: number, count: number) => number;
|
|
20
|
+
export declare function outputAnchor(node: FlowNode, portId: string): FlowPoint | undefined;
|
|
21
|
+
export declare const inputAnchor: (node: FlowNode) => FlowPoint;
|
|
22
|
+
/**
|
|
23
|
+
* The corners an edge goes through, in straight runs: down from the exit, across halfway, down into the node. An
|
|
24
|
+
* edge that goes back up turns around the side, clear of the nodes.
|
|
25
|
+
*/
|
|
26
|
+
export declare function edgeRoute(from: FlowPoint, to: FlowPoint): FlowPoint[];
|
|
27
|
+
/** An SVG path through the points, its corners rounded. */
|
|
28
|
+
export declare function roundedPath(points: readonly FlowPoint[], radius?: number): string;
|
|
29
|
+
export declare const edgePath: (from: FlowPoint, to: FlowPoint) => string;
|
|
30
|
+
/** The point halfway along `edgePath(from, to)`. */
|
|
31
|
+
export declare const edgeMidpoint: (from: FlowPoint, to: FlowPoint) => FlowPoint;
|
|
32
|
+
/** Where an edge starts and ends, or nothing when one of its ends is gone. */
|
|
33
|
+
export declare function edgeEnds(graph: FlowGraph, edge: FlowEdge): FlowEdgeEnds | undefined;
|
|
34
|
+
/** The node under a point, other than `except`. */
|
|
35
|
+
export declare const nodeAt: (graph: FlowGraph, point: FlowPoint, except?: string) => FlowNode | undefined;
|
|
36
|
+
export declare const isPortFree: (graph: FlowGraph, node: FlowNode, portId: string) => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The graph with one more edge, or nothing when the edge cannot be: a node does not connect to itself, a start takes
|
|
39
|
+
* no incoming edge, and an exit joins a node once.
|
|
40
|
+
*/
|
|
41
|
+
export declare function connect(graph: FlowGraph, edge: FlowEdge): FlowGraph | undefined;
|
|
42
|
+
export declare const moveNode: (graph: FlowGraph, id: string, position: FlowPoint) => FlowGraph;
|
|
43
|
+
/** The graph without the node, and without its edges. */
|
|
44
|
+
export declare const removeNode: (graph: FlowGraph, id: string) => FlowGraph;
|
|
45
|
+
export declare const removeEdge: (graph: FlowGraph, id: string) => FlowGraph;
|
|
46
|
+
/** Where a node added after an exit goes: a row below, under its exit, clear of the nodes after the other exits. */
|
|
47
|
+
export declare function positionAfter(graph: FlowGraph, from: string, portId: string): FlowPoint;
|
|
48
|
+
/**
|
|
49
|
+
* The nodes laid out again, top to bottom in the order they run: the starts and the nodes nothing leads to on the
|
|
50
|
+
* first row, each other node a row below the lowest node leading to it, under the exits it hangs from. Edges that
|
|
51
|
+
* loop back up do not count. Only the positions change.
|
|
52
|
+
*/
|
|
53
|
+
export declare function layoutFlow(graph: FlowGraph): FlowGraph;
|
|
54
|
+
/** Where a point of the canvas (relative to its top left corner) is in the flow's own pixels. */
|
|
55
|
+
export declare const toWorld: (viewport: FlowViewport, screen: FlowPoint) => FlowPoint;
|
|
56
|
+
/** Zooms by `factor`, keeping the point under `screen` where it is: zooming follows the pointer. */
|
|
57
|
+
export declare function zoomAt(viewport: FlowViewport, screen: FlowPoint, factor: number): FlowViewport;
|
|
58
|
+
/** The view that shows every node, centred in a canvas of this size, never larger than life. */
|
|
59
|
+
export declare function fitView(nodes: readonly FlowNode[], width: number, height: number): FlowViewport;
|
|
60
|
+
/** The view moved just enough for a node to be seen whole, its exits included; unchanged when it already is. */
|
|
61
|
+
export declare function revealIn(viewport: FlowViewport, node: FlowNode, width: number, height: number): FlowViewport;
|