@byline/ui 1.10.1 → 1.10.3
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/components/accordion/accordion.js +5 -5
- package/dist/components/accordion/accordion_module.css +6 -6
- package/dist/components/avatar/avatar.js +4 -4
- package/dist/components/avatar/avatar_module.css +4 -4
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/badge/badge_module.css +8 -8
- package/dist/components/button/button-group_module.css +2 -2
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/button_module.css +46 -42
- package/dist/components/button/combo-button_module.css +6 -6
- package/dist/components/button/control-buttons.js +1 -1
- package/dist/components/button/control-buttons_module.css +1 -1
- package/dist/components/button/copy-button.js +2 -2
- package/dist/components/button/copy-button_module.css +7 -7
- package/dist/components/card/card.js +6 -6
- package/dist/components/card/card_module.css +9 -9
- package/dist/components/chips/chip.js +5 -5
- package/dist/components/chips/chip_module.css +41 -38
- package/dist/components/container/container.js +1 -1
- package/dist/components/container/container_module.css +4 -4
- package/dist/components/dropdown/dropdown.js +8 -8
- package/dist/components/dropdown/dropdown_module.css +8 -8
- package/dist/components/hamburger/hamburger.js +3 -3
- package/dist/components/hamburger/hamburger_module.css +16 -16
- package/dist/components/inputs/autocomplete.js +9 -9
- package/dist/components/inputs/autocomplete_module.css +36 -36
- package/dist/components/inputs/checkbox-group.js +1 -1
- package/dist/components/inputs/checkbox-group_module.css +1 -1
- package/dist/components/inputs/checkbox.js +5 -5
- package/dist/components/inputs/checkbox_module.css +31 -31
- package/dist/components/inputs/error-text_module.css +4 -4
- package/dist/components/inputs/help-text.js +1 -1
- package/dist/components/inputs/help-text_module.css +4 -4
- package/dist/components/inputs/input-adornment.js +1 -1
- package/dist/components/inputs/input-adornment_module.css +3 -3
- package/dist/components/inputs/input.js +5 -5
- package/dist/components/inputs/input_module.css +38 -38
- package/dist/components/inputs/label_module.css +2 -2
- package/dist/components/inputs/radio-group.js +1 -1
- package/dist/components/inputs/radio-group_module.css +18 -18
- package/dist/components/inputs/select.js +3 -3
- package/dist/components/inputs/select_module.css +8 -8
- package/dist/components/inputs/text-area.js +1 -1
- package/dist/components/inputs/text-area_module.css +3 -3
- package/dist/components/notifications/alert.js +10 -10
- package/dist/components/notifications/alert_module.css +16 -16
- package/dist/components/notifications/toast.js +7 -7
- package/dist/components/notifications/toast_module.css +25 -24
- package/dist/components/pager/pagination.js +2 -2
- package/dist/components/pager/pagination_module.css +6 -6
- package/dist/components/scroll-area/scroll-area.js +7 -7
- package/dist/components/scroll-area/scroll-area_module.css +9 -9
- package/dist/components/scroll-to-top/scroll-to-top.js +2 -2
- package/dist/components/scroll-to-top/scroll-to-top_module.css +9 -9
- package/dist/components/section/section.js +1 -1
- package/dist/components/section/section_module.css +1 -1
- package/dist/components/shimmer/shimmer_module.css +6 -6
- package/dist/components/table/table.js +8 -8
- package/dist/components/table/table_module.css +15 -15
- package/dist/components/tabs/tabs.js +4 -4
- package/dist/components/tabs/tabs_module.css +9 -9
- package/dist/components/tooltip/tooltip.js +2 -2
- package/dist/components/tooltip/tooltip_module.css +6 -6
- package/dist/fields/checkbox/checkbox-field.js +2 -1
- package/dist/fields/checkbox/checkbox-field.module.js +6 -0
- package/dist/fields/checkbox/checkbox-field_module.css +4 -0
- package/dist/forms/form-context.d.ts +1 -0
- package/dist/forms/form-context.js +3 -2
- package/dist/forms/form-renderer.js +19 -20
- package/dist/loaders/ellipses.js +2 -2
- package/dist/loaders/ellipses_module.css +2 -2
- package/dist/loaders/ring.js +2 -2
- package/dist/loaders/ring_module.css +2 -2
- package/dist/loaders/spinner.js +3 -3
- package/dist/loaders/spinner_module.css +3 -3
- package/dist/styles/styles.css +12 -0
- package/dist/widgets/datepicker/datepicker.js +11 -11
- package/dist/widgets/datepicker/datepicker_module.css +21 -21
- package/dist/widgets/drawer/drawer-container.js +1 -1
- package/dist/widgets/drawer/drawer-content.js +1 -1
- package/dist/widgets/drawer/drawer-header.js +1 -1
- package/dist/widgets/drawer/drawer-top-actions.js +1 -1
- package/dist/widgets/drawer/drawer.js +2 -2
- package/dist/widgets/drawer/drawer_module.css +11 -11
- package/dist/widgets/modal/modal-actions.js +1 -1
- package/dist/widgets/modal/modal-container.js +1 -1
- package/dist/widgets/modal/modal-content.js +1 -1
- package/dist/widgets/modal/modal-header.js +1 -1
- package/dist/widgets/modal/modal.js +2 -2
- package/dist/widgets/modal/modal_module.css +12 -12
- package/dist/widgets/search/search.js +6 -0
- package/dist/widgets/timeline/timeline_module.css +10 -10
- package/package.json +14 -14
- package/src/components/accordion/accordion.module.css +4 -4
- package/src/components/accordion/accordion.tsx +5 -5
- package/src/components/avatar/avatar.module.css +4 -4
- package/src/components/avatar/avatar.tsx +4 -4
- package/src/components/badge/badge.module.css +8 -8
- package/src/components/badge/badge.tsx +2 -2
- package/src/components/button/button-group.module.css +2 -2
- package/src/components/button/button.module.css +162 -86
- package/src/components/button/button.tsx +4 -4
- package/src/components/button/combo-button.module.css +7 -7
- package/src/components/button/control-buttons.module.css +5 -5
- package/src/components/button/control-buttons.tsx +1 -1
- package/src/components/button/copy-button.module.css +7 -7
- package/src/components/button/copy-button.tsx +5 -5
- package/src/components/card/card.module.css +9 -9
- package/src/components/card/card.tsx +6 -6
- package/src/components/chips/chip.module.css +126 -71
- package/src/components/chips/chip.tsx +8 -12
- package/src/components/container/container.module.css +4 -4
- package/src/components/container/container.tsx +1 -1
- package/src/components/dropdown/dropdown.module.css +7 -7
- package/src/components/dropdown/dropdown.tsx +8 -8
- package/src/components/hamburger/hamburger.module.css +16 -16
- package/src/components/hamburger/hamburger.tsx +3 -3
- package/src/components/inputs/autocomplete.module.css +42 -42
- package/src/components/inputs/autocomplete.tsx +12 -14
- package/src/components/inputs/checkbox-group.module.css +1 -1
- package/src/components/inputs/checkbox-group.tsx +1 -1
- package/src/components/inputs/checkbox.module.css +38 -34
- package/src/components/inputs/checkbox.tsx +8 -11
- package/src/components/inputs/error-text.module.css +4 -4
- package/src/components/inputs/help-text.module.css +4 -4
- package/src/components/inputs/help-text.tsx +1 -3
- package/src/components/inputs/input-adornment.module.css +3 -3
- package/src/components/inputs/input-adornment.tsx +2 -2
- package/src/components/inputs/input.module.css +45 -45
- package/src/components/inputs/input.tsx +8 -12
- package/src/components/inputs/label.module.css +2 -2
- package/src/components/inputs/radio-group.module.css +17 -17
- package/src/components/inputs/radio-group.tsx +1 -1
- package/src/components/inputs/select.module.css +8 -8
- package/src/components/inputs/select.tsx +3 -3
- package/src/components/inputs/text-area.module.css +4 -4
- package/src/components/inputs/text-area.tsx +3 -3
- package/src/components/notifications/alert.module.css +16 -16
- package/src/components/notifications/alert.tsx +11 -11
- package/src/components/notifications/toast.module.css +41 -28
- package/src/components/notifications/toast.tsx +7 -9
- package/src/components/pager/pagination.module.css +6 -6
- package/src/components/pager/pagination.tsx +2 -2
- package/src/components/scroll-area/scroll-area.module.css +5 -5
- package/src/components/scroll-area/scroll-area.tsx +7 -7
- package/src/components/scroll-to-top/scroll-to-top.module.css +9 -9
- package/src/components/scroll-to-top/scroll-to-top.tsx +2 -2
- package/src/components/section/section.module.css +1 -1
- package/src/components/section/section.tsx +1 -1
- package/src/components/shimmer/shimmer.module.css +18 -8
- package/src/components/table/table.module.css +15 -15
- package/src/components/table/table.tsx +8 -8
- package/src/components/tabs/tabs.module.css +4 -4
- package/src/components/tabs/tabs.tsx +4 -4
- package/src/components/tooltip/tooltip.module.css +2 -2
- package/src/components/tooltip/tooltip.tsx +2 -2
- package/src/fields/checkbox/checkbox-field.module.css +4 -0
- package/src/fields/checkbox/checkbox-field.tsx +2 -1
- package/src/forms/form-context.tsx +10 -2
- package/src/forms/form-renderer.tsx +44 -30
- package/src/icons/source/icon-infonomic.svg +2 -2
- package/src/loaders/ellipses.module.css +2 -2
- package/src/loaders/ellipses.tsx +2 -2
- package/src/loaders/ring.module.css +2 -2
- package/src/loaders/ring.tsx +2 -2
- package/src/loaders/spinner.module.css +3 -3
- package/src/loaders/spinner.tsx +3 -6
- package/src/styles/styles.css +12 -0
- package/src/widgets/datepicker/datepicker.module.css +15 -15
- package/src/widgets/datepicker/datepicker.tsx +11 -21
- package/src/widgets/drawer/drawer-container.tsx +1 -1
- package/src/widgets/drawer/drawer-content.tsx +1 -1
- package/src/widgets/drawer/drawer-header.tsx +1 -1
- package/src/widgets/drawer/drawer-top-actions.tsx +1 -1
- package/src/widgets/drawer/drawer.module.css +11 -11
- package/src/widgets/drawer/drawer.tsx +2 -2
- package/src/widgets/modal/modal-actions.tsx +1 -1
- package/src/widgets/modal/modal-container.tsx +1 -1
- package/src/widgets/modal/modal-content.tsx +1 -1
- package/src/widgets/modal/modal-header.tsx +1 -1
- package/src/widgets/modal/modal.module.css +12 -12
- package/src/widgets/modal/modal.tsx +2 -2
- package/src/widgets/search/search.tsx +2 -0
- package/src/widgets/timeline/timeline.module.css +10 -10
|
@@ -12,11 +12,16 @@
|
|
|
12
12
|
/* 'border-collapse w-full text-sm text-left text-gray-700 dark:text-gray-400 m-0', */
|
|
13
13
|
@layer byline-components {
|
|
14
14
|
.shimmer,
|
|
15
|
-
:global(.
|
|
15
|
+
:global(.byline-shimmer) {
|
|
16
16
|
position: relative;
|
|
17
17
|
overflow: hidden;
|
|
18
18
|
background-color: #f0f0f0;
|
|
19
|
-
background-image: linear-gradient(
|
|
19
|
+
background-image: linear-gradient(
|
|
20
|
+
90deg,
|
|
21
|
+
transparent,
|
|
22
|
+
rgba(255, 255, 255, 0.6),
|
|
23
|
+
transparent
|
|
24
|
+
);
|
|
20
25
|
background-size: 200% 100%;
|
|
21
26
|
animation: shimmer 1.5s infinite;
|
|
22
27
|
}
|
|
@@ -24,31 +29,36 @@
|
|
|
24
29
|
:global(.dark),
|
|
25
30
|
:global([data-theme="dark"]) {
|
|
26
31
|
.shimmer,
|
|
27
|
-
:global(.
|
|
32
|
+
:global(.byline-shimmer) {
|
|
28
33
|
background-color: #141414;
|
|
29
|
-
background-image: linear-gradient(
|
|
34
|
+
background-image: linear-gradient(
|
|
35
|
+
90deg,
|
|
36
|
+
transparent,
|
|
37
|
+
rgba(255, 255, 255, 0.01),
|
|
38
|
+
transparent
|
|
39
|
+
);
|
|
30
40
|
}
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
.shimmerContainer,
|
|
34
|
-
:global(.
|
|
44
|
+
:global(.byline-shimmer-container) {
|
|
35
45
|
display: flex;
|
|
36
46
|
flex-direction: column;
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
.rectangular,
|
|
40
|
-
:global(.
|
|
50
|
+
:global(.byline-shimmer-rectangular) {
|
|
41
51
|
border-radius: 0.25rem;
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
.text,
|
|
45
|
-
:global(.
|
|
55
|
+
:global(.byline-shimmer-text) {
|
|
46
56
|
border-radius: 0.125rem;
|
|
47
57
|
height: 1rem;
|
|
48
58
|
}
|
|
49
59
|
|
|
50
60
|
.circular,
|
|
51
|
-
:global(.
|
|
61
|
+
:global(.byline-shimmer-circular) {
|
|
52
62
|
border-radius: 50%;
|
|
53
63
|
aspect-ratio: 1;
|
|
54
64
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
@layer byline-components {
|
|
14
14
|
/* 'table--container break-normal overflow-hidden relative shadow-md rounded-md my-[16px] dark:border dark:border-canvas-700', */
|
|
15
15
|
.table-container,
|
|
16
|
-
:global(.
|
|
16
|
+
:global(.byline-table-container) {
|
|
17
17
|
display: block;
|
|
18
18
|
overflow: hidden;
|
|
19
19
|
word-break: normal;
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.table-scroller,
|
|
27
|
-
:global(.
|
|
27
|
+
:global(.byline-table-scroller) {
|
|
28
28
|
overflow-x: auto;
|
|
29
29
|
max-width: calc(100vw - 32px);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.table,
|
|
33
|
-
:global(.
|
|
33
|
+
:global(.byline-table) {
|
|
34
34
|
width: 100%;
|
|
35
35
|
border-collapse: collapse;
|
|
36
36
|
margin: 0;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
/* 'text-xs text-gray-700 uppercase bg-canvas-100 dark:bg-canvas-700 dark:text-gray-400', */
|
|
42
42
|
.table-header,
|
|
43
|
-
:global(.
|
|
43
|
+
:global(.byline-table-header) {
|
|
44
44
|
font-size: var(--font-size-sm);
|
|
45
45
|
/* text-transform: uppercase; */
|
|
46
46
|
background-color: var(--canvas-50);
|
|
@@ -48,19 +48,19 @@
|
|
|
48
48
|
|
|
49
49
|
/* 'border-b border-solid border-canvas-200 bg-white hover:bg-canvas-100/50 dark:border-canvas-700/60 dark:bg-canvas-800/50 dark:hover:bg-canvas-700/50', */
|
|
50
50
|
.table-row,
|
|
51
|
-
:global(.
|
|
51
|
+
:global(.byline-table-row) {
|
|
52
52
|
border-bottom: 1px solid var(--canvas-50);
|
|
53
53
|
background-color: white;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.table-row:hover,
|
|
57
|
-
:global(.
|
|
57
|
+
:global(.byline-table-row:hover) {
|
|
58
58
|
background-color: var(--canvas-50);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/* 'whitespace-nowrap px-2 py-4 text-sm text-gray-700 uppercase bg-canvas-100/50 dark:bg-canvas-800/50 dark:text-gray-200', */
|
|
62
62
|
.table-heading-cell,
|
|
63
|
-
:global(.
|
|
63
|
+
:global(.byline-table-heading-cell) {
|
|
64
64
|
white-space: nowrap;
|
|
65
65
|
padding: var(--spacing-8) var(--spacing-8);
|
|
66
66
|
font-size: 0.975rem;
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
|
|
72
72
|
/* not-prose px-2 py-2 text-sm [&_a]:underline */
|
|
73
73
|
.table-cell,
|
|
74
|
-
:global(.
|
|
74
|
+
:global(.byline-table-cell) {
|
|
75
75
|
padding: var(--spacing-8);
|
|
76
76
|
font-size: var(--font-size-sm);
|
|
77
77
|
|
|
@@ -82,13 +82,13 @@
|
|
|
82
82
|
|
|
83
83
|
/* 'text-xs text-gray-700 uppercase bg-canvas-100 dark:bg-canvas-700 dark:text-gray-400', */
|
|
84
84
|
.table-footer,
|
|
85
|
-
:global(.
|
|
85
|
+
:global(.byline-table-footer) {
|
|
86
86
|
font-size: var(--font-size-sm);
|
|
87
87
|
/* text-transform: uppercase; */
|
|
88
88
|
background-color: var(--canvas-100);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
/* 🌙 Dark via `.dark` class. We rely on the
|
|
91
|
+
/* 🌙 Dark via `.dark` class. We rely on the
|
|
92
92
|
* consuming application to detect a user's preferred
|
|
93
93
|
* color scheme - either by header or cookie, and set
|
|
94
94
|
* a root html class accordingly
|
|
@@ -96,28 +96,28 @@
|
|
|
96
96
|
:global(.dark),
|
|
97
97
|
:global([data-theme="dark"]) {
|
|
98
98
|
.table-header,
|
|
99
|
-
:global(.
|
|
99
|
+
:global(.byline-table-header) {
|
|
100
100
|
background-color: var(--canvas-700);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
.table-row,
|
|
104
|
-
:global(.
|
|
104
|
+
:global(.byline-table-row) {
|
|
105
105
|
border-bottom: 1px solid var(--canvas-700);
|
|
106
106
|
background-color: var(--canvas-800);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.table-row:hover,
|
|
110
|
-
:global(.
|
|
110
|
+
:global(.byline-table-row:hover) {
|
|
111
111
|
background-color: oklch(from var(--canvas-800) calc(l * 1.1) c h);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
.table-heading-cell,
|
|
115
|
-
:global(.
|
|
115
|
+
:global(.byline-table-heading-cell) {
|
|
116
116
|
background-color: oklch(from var(--canvas-800) calc(l * 1.1) c h);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.table-footer,
|
|
120
|
-
:global(.
|
|
120
|
+
:global(.byline-table-footer) {
|
|
121
121
|
background-color: var(--canvas-800);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -14,7 +14,7 @@ function Table({
|
|
|
14
14
|
}: TableProps & {
|
|
15
15
|
ref?: React.RefObject<HTMLTableElement>
|
|
16
16
|
}): React.JSX.Element {
|
|
17
|
-
const classes = cx(styles.table, '
|
|
17
|
+
const classes = cx(styles.table, 'byline-table', className)
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<table ref={ref} className={classes} {...rest}>
|
|
@@ -33,10 +33,10 @@ function Container({
|
|
|
33
33
|
}: TableContainerProps & {
|
|
34
34
|
ref?: React.RefObject<HTMLDivElement>
|
|
35
35
|
}) {
|
|
36
|
-
const classes = cx(styles['table-container'], '
|
|
36
|
+
const classes = cx(styles['table-container'], 'byline-table-container', className)
|
|
37
37
|
return (
|
|
38
38
|
<div ref={ref} className={classes} {...rest}>
|
|
39
|
-
<div className={cx('
|
|
39
|
+
<div className={cx('byline-table-scroller', styles['table-scroller'])}>{children}</div>
|
|
40
40
|
</div>
|
|
41
41
|
)
|
|
42
42
|
}
|
|
@@ -52,7 +52,7 @@ function Body({
|
|
|
52
52
|
ref?: React.RefObject<HTMLTableSectionElement>
|
|
53
53
|
}): React.JSX.Element {
|
|
54
54
|
return (
|
|
55
|
-
<tbody ref={ref} className={cx('
|
|
55
|
+
<tbody ref={ref} className={cx('byline-table-body', className)} {...rest}>
|
|
56
56
|
{children}
|
|
57
57
|
</tbody>
|
|
58
58
|
)
|
|
@@ -68,7 +68,7 @@ function Header({
|
|
|
68
68
|
}: TableHeaderProps & {
|
|
69
69
|
ref?: React.RefObject<HTMLTableSectionElement>
|
|
70
70
|
}): React.JSX.Element {
|
|
71
|
-
const classes = cx(styles['table-header'], '
|
|
71
|
+
const classes = cx(styles['table-header'], 'byline-table-header', className)
|
|
72
72
|
|
|
73
73
|
return (
|
|
74
74
|
<thead ref={ref} className={classes} {...rest}>
|
|
@@ -87,7 +87,7 @@ function Row({
|
|
|
87
87
|
}: TableRowProps & {
|
|
88
88
|
ref?: React.RefObject<HTMLTableRowElement>
|
|
89
89
|
}): React.JSX.Element {
|
|
90
|
-
const classes = cx(styles['table-row'], '
|
|
90
|
+
const classes = cx(styles['table-row'], 'byline-table-row', className)
|
|
91
91
|
|
|
92
92
|
return (
|
|
93
93
|
<tr ref={ref} className={classes} {...rest}>
|
|
@@ -108,7 +108,7 @@ function HeadingCell({
|
|
|
108
108
|
}): React.JSX.Element {
|
|
109
109
|
const classes = cx(
|
|
110
110
|
styles['table-heading-cell'],
|
|
111
|
-
'
|
|
111
|
+
'byline-table-heading-cell',
|
|
112
112
|
'not-prose',
|
|
113
113
|
className
|
|
114
114
|
)
|
|
@@ -129,7 +129,7 @@ function Cell({
|
|
|
129
129
|
}: TableCellProps & {
|
|
130
130
|
ref?: React.RefObject<HTMLTableCellElement>
|
|
131
131
|
}): React.JSX.Element {
|
|
132
|
-
const classes = cx(styles['table-cell'], '
|
|
132
|
+
const classes = cx(styles['table-cell'], 'byline-table-cell', className)
|
|
133
133
|
|
|
134
134
|
return (
|
|
135
135
|
<td ref={ref} className={classes} {...rest}>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
@layer byline-components {
|
|
13
13
|
.tabs-root,
|
|
14
|
-
:global(.
|
|
14
|
+
:global(.byline-tabs-root) {
|
|
15
15
|
display: flex;
|
|
16
16
|
padding: var(--spacing-8);
|
|
17
17
|
flex-direction: column;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.tabs-list,
|
|
24
|
-
:global(.
|
|
24
|
+
:global(.byline-tabs-list) {
|
|
25
25
|
display: flex;
|
|
26
26
|
width: 100%;
|
|
27
27
|
gap: var(--gap-2);
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.tabs-trigger,
|
|
39
|
-
:global(.
|
|
39
|
+
:global(.byline-tabs-trigger) {
|
|
40
40
|
align-items: center;
|
|
41
41
|
justify-content: center;
|
|
42
42
|
white-space: nowrap;
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.tabs-content,
|
|
51
|
-
:global(.
|
|
51
|
+
:global(.byline-tabs-content) {
|
|
52
52
|
margin-top: var(--spacing-8);
|
|
53
53
|
padding: 6px;
|
|
54
54
|
outline: none;
|
|
@@ -16,7 +16,7 @@ const Tabs = ({
|
|
|
16
16
|
}) => (
|
|
17
17
|
<TabsPrimitive.Root
|
|
18
18
|
ref={ref}
|
|
19
|
-
className={cx(styles['tabs-root'], '
|
|
19
|
+
className={cx(styles['tabs-root'], 'byline-tabs-root', className)}
|
|
20
20
|
{...props}
|
|
21
21
|
/>
|
|
22
22
|
)
|
|
@@ -31,7 +31,7 @@ const TabsList = ({
|
|
|
31
31
|
}) => (
|
|
32
32
|
<TabsPrimitive.List
|
|
33
33
|
ref={ref}
|
|
34
|
-
className={cx(styles['tabs-list'], '
|
|
34
|
+
className={cx(styles['tabs-list'], 'byline-tabs-list', className)}
|
|
35
35
|
{...props}
|
|
36
36
|
/>
|
|
37
37
|
)
|
|
@@ -46,7 +46,7 @@ const TabsTrigger = ({
|
|
|
46
46
|
}) => (
|
|
47
47
|
<TabsPrimitive.Tab
|
|
48
48
|
ref={ref}
|
|
49
|
-
className={cx(styles['tabs-trigger'], '
|
|
49
|
+
className={cx(styles['tabs-trigger'], 'byline-tabs-trigger', className)}
|
|
50
50
|
{...props}
|
|
51
51
|
/>
|
|
52
52
|
)
|
|
@@ -63,7 +63,7 @@ const TabsContent = ({
|
|
|
63
63
|
<TabsPrimitive.Panel
|
|
64
64
|
ref={ref}
|
|
65
65
|
keepMounted={keepMounted}
|
|
66
|
-
className={cx(styles['tabs-content'], '
|
|
66
|
+
className={cx(styles['tabs-content'], 'byline-tabs-content', className)}
|
|
67
67
|
{...props}
|
|
68
68
|
/>
|
|
69
69
|
)
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
@layer byline-components {
|
|
13
13
|
.tooltip,
|
|
14
|
-
:global(.
|
|
14
|
+
:global(.byline-tooltip) {
|
|
15
15
|
font-size: 0.75rem;
|
|
16
16
|
line-height: 1;
|
|
17
17
|
color: var(--surface-item-text);
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.tooltip-arrow,
|
|
49
|
-
:global(.
|
|
49
|
+
:global(.byline-tooltip-arrow) {
|
|
50
50
|
display: flex;
|
|
51
51
|
|
|
52
52
|
&[data-side="top"] {
|
|
@@ -67,9 +67,9 @@ export const Tooltip = function Tooltip({
|
|
|
67
67
|
<TooltipPrimitive.Trigger render={children} />
|
|
68
68
|
<TooltipPrimitive.Portal>
|
|
69
69
|
<TooltipPrimitive.Positioner ref={ref} side={side} sideOffset={sideOffset}>
|
|
70
|
-
<TooltipPrimitive.Popup className={cx(styles.tooltip, '
|
|
70
|
+
<TooltipPrimitive.Popup className={cx(styles.tooltip, 'byline-tooltip')}>
|
|
71
71
|
<TooltipPrimitive.Arrow
|
|
72
|
-
className={cx(styles['tooltip-arrow'], '
|
|
72
|
+
className={cx(styles['tooltip-arrow'], 'byline-tooltip-arrow')}
|
|
73
73
|
>
|
|
74
74
|
<ArrowSvg />
|
|
75
75
|
</TooltipPrimitive.Arrow>
|
|
@@ -10,6 +10,7 @@ import type { CheckboxField as FieldType } from '@byline/core'
|
|
|
10
10
|
|
|
11
11
|
import { useFieldError, useFieldValue } from '../../forms/form-context'
|
|
12
12
|
import { Checkbox } from '../../uikit.js'
|
|
13
|
+
import styles from './checkbox-field.module.css'
|
|
13
14
|
|
|
14
15
|
export const CheckboxField = ({
|
|
15
16
|
field,
|
|
@@ -32,7 +33,7 @@ export const CheckboxField = ({
|
|
|
32
33
|
const checked = value ?? fieldValue ?? defaultValue ?? false
|
|
33
34
|
|
|
34
35
|
return (
|
|
35
|
-
<div className={`byline-field-checkbox ${field.name}`}>
|
|
36
|
+
<div className={`byline-field-checkbox ${field.name} ${styles['field-checkbox']}`}>
|
|
36
37
|
<Checkbox
|
|
37
38
|
id={id ?? fieldPath}
|
|
38
39
|
name={field.name}
|
|
@@ -52,6 +52,7 @@ interface FormContextType {
|
|
|
52
52
|
runFieldHooks: (fields: Field[]) => Promise<FormError[]>
|
|
53
53
|
validateForm: (fields: Field[]) => FormError[]
|
|
54
54
|
errors: FormError[]
|
|
55
|
+
getErrors: () => FormError[]
|
|
55
56
|
clearErrors: () => void
|
|
56
57
|
setFieldError: (field: string, message: string) => void
|
|
57
58
|
clearFieldError: (field: string) => void
|
|
@@ -520,6 +521,7 @@ export const FormProvider = ({
|
|
|
520
521
|
runFieldHooks,
|
|
521
522
|
validateForm,
|
|
522
523
|
errors: errorsRef.current,
|
|
524
|
+
getErrors: () => errorsRef.current,
|
|
523
525
|
clearErrors,
|
|
524
526
|
setFieldError,
|
|
525
527
|
clearFieldError,
|
|
@@ -562,9 +564,15 @@ export const useFormStore = () => {
|
|
|
562
564
|
}
|
|
563
565
|
|
|
564
566
|
export const useFieldError = (name: string) => {
|
|
565
|
-
const {
|
|
567
|
+
const { getErrors, subscribeErrors } = useFormContext()
|
|
568
|
+
// Seed from the live errors ref via getErrors() rather than the context's
|
|
569
|
+
// `errors` snapshot — the snapshot is bound at FormProvider's first render
|
|
570
|
+
// and goes stale as soon as validateForm replaces errorsRef.current. Fields
|
|
571
|
+
// mounted after validation has already run (e.g. switching to a tab whose
|
|
572
|
+
// error badge is non-zero) would otherwise initialise to undefined and miss
|
|
573
|
+
// the existing error until something else fires notifyErrorListeners.
|
|
566
574
|
const [error, setError] = useState<string | undefined>(
|
|
567
|
-
|
|
575
|
+
() => getErrors().find((e) => e.field === name)?.message
|
|
568
576
|
)
|
|
569
577
|
|
|
570
578
|
useEffect(() => {
|
|
@@ -202,8 +202,12 @@ const FormStatusDisplay = ({
|
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
204
|
* Compute the primary and secondary status transitions for the ComboButton.
|
|
205
|
-
* - Primary: the main action (forward step, or
|
|
206
|
-
*
|
|
205
|
+
* - Primary: the main action (forward step), or the current status itself
|
|
206
|
+
* when the document has reached the final workflow step (terminal state).
|
|
207
|
+
* - Secondary: other available transitions to show as dropdown options.
|
|
208
|
+
* - isTerminal: true when the document is at the final workflow status —
|
|
209
|
+
* the primary button renders as a non-actionable indicator and all
|
|
210
|
+
* back-steps move into the dropdown.
|
|
207
211
|
*/
|
|
208
212
|
function computeStatusTransitions(
|
|
209
213
|
currentStatus: string | undefined,
|
|
@@ -212,20 +216,21 @@ function computeStatusTransitions(
|
|
|
212
216
|
): {
|
|
213
217
|
primaryStatus: WorkflowStatus | undefined
|
|
214
218
|
secondaryStatuses: WorkflowStatus[]
|
|
219
|
+
isTerminal: boolean
|
|
215
220
|
} {
|
|
216
221
|
if (!workflowStatuses || workflowStatuses.length === 0 || !currentStatus) {
|
|
217
|
-
return { primaryStatus: nextStatus, secondaryStatuses: [] }
|
|
222
|
+
return { primaryStatus: nextStatus, secondaryStatuses: [], isTerminal: false }
|
|
218
223
|
}
|
|
219
224
|
|
|
220
225
|
// Single-status workflows (e.g. SINGLE_STATUS_WORKFLOW for lookups) have
|
|
221
226
|
// no transitions — short-circuit so the form shows only Close / Save.
|
|
222
227
|
if (workflowStatuses.length <= 1) {
|
|
223
|
-
return { primaryStatus: undefined, secondaryStatuses: [] }
|
|
228
|
+
return { primaryStatus: undefined, secondaryStatuses: [], isTerminal: false }
|
|
224
229
|
}
|
|
225
230
|
|
|
226
231
|
const currentIndex = workflowStatuses.findIndex((s) => s.name === currentStatus)
|
|
227
232
|
if (currentIndex === -1) {
|
|
228
|
-
return { primaryStatus: nextStatus, secondaryStatuses: [] }
|
|
233
|
+
return { primaryStatus: nextStatus, secondaryStatuses: [], isTerminal: false }
|
|
229
234
|
}
|
|
230
235
|
|
|
231
236
|
const isAtEnd = currentIndex === workflowStatuses.length - 1
|
|
@@ -249,22 +254,23 @@ function computeStatusTransitions(
|
|
|
249
254
|
availableTargets.push(workflowStatuses[currentIndex + 1])
|
|
250
255
|
}
|
|
251
256
|
|
|
252
|
-
// Determine primary and secondary
|
|
253
|
-
let primaryStatus: WorkflowStatus | undefined
|
|
254
|
-
let secondaryStatuses: WorkflowStatus[]
|
|
255
|
-
|
|
256
257
|
if (isAtEnd) {
|
|
257
|
-
//
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
258
|
+
// Terminal state: the primary button is a non-actionable indicator of the
|
|
259
|
+
// current status; both back-steps (revert to previous / reset to first)
|
|
260
|
+
// are surfaced in the dropdown.
|
|
261
|
+
return {
|
|
262
|
+
primaryStatus: workflowStatuses[currentIndex],
|
|
263
|
+
secondaryStatuses: availableTargets,
|
|
264
|
+
isTerminal: true,
|
|
265
|
+
}
|
|
265
266
|
}
|
|
266
267
|
|
|
267
|
-
|
|
268
|
+
// Not at end: primary is the forward step (nextStatus)
|
|
269
|
+
return {
|
|
270
|
+
primaryStatus: nextStatus,
|
|
271
|
+
secondaryStatuses: availableTargets.filter((s) => s.name !== nextStatus?.name),
|
|
272
|
+
isTerminal: false,
|
|
273
|
+
}
|
|
268
274
|
}
|
|
269
275
|
|
|
270
276
|
const FormContent = ({
|
|
@@ -461,7 +467,7 @@ const FormContent = ({
|
|
|
461
467
|
|
|
462
468
|
// Compute available status transitions
|
|
463
469
|
const currentStatus = initialData?.status
|
|
464
|
-
const { primaryStatus, secondaryStatuses } = computeStatusTransitions(
|
|
470
|
+
const { primaryStatus, secondaryStatuses, isTerminal } = computeStatusTransitions(
|
|
465
471
|
currentStatus,
|
|
466
472
|
workflowStatuses,
|
|
467
473
|
nextStatus
|
|
@@ -673,13 +679,15 @@ const FormContent = ({
|
|
|
673
679
|
styles['actions-combo-trigger']
|
|
674
680
|
)}
|
|
675
681
|
options={secondaryStatuses.map((s) => ({
|
|
676
|
-
label:
|
|
682
|
+
label: isTerminal
|
|
683
|
+
? `Revert to ${s.label ?? s.name}`
|
|
684
|
+
: (s.verb ?? s.label ?? s.name),
|
|
677
685
|
value: s.name,
|
|
678
686
|
}))}
|
|
679
687
|
sideOffset={5}
|
|
680
688
|
size="sm"
|
|
681
689
|
type="button"
|
|
682
|
-
intent=
|
|
690
|
+
intent={isTerminal ? 'info' : 'success'}
|
|
683
691
|
disabled={statusBusy}
|
|
684
692
|
onOptionSelect={async (value: string) => {
|
|
685
693
|
setStatusBusy(true)
|
|
@@ -689,18 +697,24 @@ const FormContent = ({
|
|
|
689
697
|
setStatusBusy(false)
|
|
690
698
|
}
|
|
691
699
|
}}
|
|
692
|
-
onButtonClick={
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
+
onButtonClick={
|
|
701
|
+
isTerminal
|
|
702
|
+
? undefined
|
|
703
|
+
: async () => {
|
|
704
|
+
setStatusBusy(true)
|
|
705
|
+
try {
|
|
706
|
+
await onStatusChange(primaryStatus.name)
|
|
707
|
+
} finally {
|
|
708
|
+
setStatusBusy(false)
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
700
712
|
>
|
|
701
713
|
{statusBusy
|
|
702
714
|
? '...'
|
|
703
|
-
:
|
|
715
|
+
: isTerminal
|
|
716
|
+
? (primaryStatus.label ?? primaryStatus.name)
|
|
717
|
+
: (primaryStatus.verb ?? primaryStatus.label ?? primaryStatus.name)}
|
|
704
718
|
</ComboButton>
|
|
705
719
|
</div>
|
|
706
720
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg data-name="
|
|
1
|
+
<svg data-name="byline-icon"
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512">
|
|
4
4
|
<defs>
|
|
@@ -40,4 +40,4 @@
|
|
|
40
40
|
<path d="M436.21,178.4c.68-1,4.69-7.09,4.85-7.34.46-.71,4.89-8.17,5.18-8.68,38.11-67.56,27.78-139,18.78-147C451.83,3.74,361.31,40.33,370.19,48.31,411.55,28.15,452,24.85,455.1,27.42c4.63,3.85,12.22,91.46-38.4,152.11-29,34.76-86.92,80-106.27,94.77-4.1,3.13-6,7-5.38,10.37,1.93,11.12,4.74,36.2-6.5,48-14.68,15.45-67,33-70.56,27.84s53.54-49.8,16.51-81.23c-4.91-4.16-9.69-5.83-14.54-8.22l.58-.05.08.86c-31.77-7.59-57.56,40.82-62.5,38.58-5.69-2.58,1.9-57.17,14.47-74.38a25.2,25.2,0,0,1,7.11-6.45h0s-17.83,4.52-25.59,34.08c-5.47,20.86-6.35,47.39-6.39,61.21,0,5.77-7.47,6.32-7.29-3,.21-10.48-1.76-23.93-13.51-34.46-20-17.94-44.4-5.17-51.67-.11-1.55,1.08-3.09-1.63-3.5-3.26-6.14-24.67-21.64-34.24-21.64-34.24C59.73,168.36,125.14,97.53,169.25,75.8A218.31,218.31,0,0,0,25,286.64c29.43,6.51,38.81,32.9,41.79,48.63,1.34,7.06,3,4,4.74.48,5.52-11.33,16.24-23.12,34.35-21.5,25.51,2.29,29.92,26.9,30.78,38.8.28,4,3.25,5.2,5.33,4,22.45-13.36,82.2-65.62,82.2-65.62s3.28-3.29,7.25-3.07a8,8,0,0,1,4.28,1.76c5.59,4.66.73,11.51.73,11.51s-40.77,68-49.88,92.51c-.84,2.26.9,4.77,4.86,4.34.36,0,.71-.26,1.1-.3h0a74.82,74.82,0,0,1,9.47-.1c12.43.51,28,5.08,33.2,23.71,4.87,17.5-4.8,30.19-15,37.66-3.17,2.33-5.87,4.55,1.33,4.59,16.07.09,44.17,4.42,55.85,32.33,10.5-1.64,20.94-3.29,31.4-7.33h0s-.22.12-.18.11c.68-.21,15.14-5,24.25-9.37.12-.05,0-.32.17-.33h0a207.63,207.63,0,0,0,55.56-35.75c29.25-24.79,41.58-41,54.6-74.54A218.22,218.22,0,0,0,436.21,178.4ZM313.13,451.63v.05c-15-9.82-32.77-7.85-41-6.17-2.87.59-2.95-1.67-2.27-3.09,9.28-19.34,1.95-38.85-10.07-46.69-15.18-9.89-37.53-4.54-38.94-6.1-2.62-2.9,3.69-11,3.69-11,24.4-4.56,55-18,77.92-30.55s21.36-43.67,18.56-54.36,5.37-13.79,5.37-13.79c35.34-23,76.85-65.66,97.22-87.62l-.12.21S488,363.72,313.13,451.63Z" fill="url(#e82ad6d9-f6de-470e-9cc8-5c1e25860ae0)"/>
|
|
41
41
|
<path d="M171.89,307.66s16.44-49.68,27.18-55.37,48.65,7.88,46.05,11c-.65.78-2.63,1.43-5.49,2.1-8.55,2-24.91,4.13-36.35,10.09C188,283.41,171.82,315.53,171.89,307.66Z" fill="url(#a031a507-2f2b-46ac-8fd0-d46923b5cede)"/>
|
|
42
42
|
<path d="M24.87,286.91C28.47,405.21,124.8,500,243.09,500A219.07,219.07,0,0,0,277,497.36c-12-27.17-39.24-31.58-55.11-31.67-7.2,0-4.49-2.26-1.32-4.61,10.18-7.55,19.87-20.33,15-38-6.87-24.9-31.94-24.79-43.83-23.48-4,.44-5.72-2.28-4.88-4.57,9.12-24.71,49.93-93.46,49.93-93.46s4.87-6.92-.73-11.63-11.54,1.32-11.54,1.32-59.83,52.8-82.31,66.29c-2.08,1.25-5,0-5.34-4-.86-12-5.28-36.88-30.82-39.2-18.14-1.65-28.87,10.26-34.4,21.71-1.73,3.57-3.4,6.65-4.74-.48-3-15.89-12.38-42.57-41.85-49.15Z" fill="url(#a9106638-56d4-4f79-8812-bed67cfca285)"/>
|
|
43
|
-
</svg>
|
|
43
|
+
</svg>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
@layer byline-components {
|
|
13
13
|
.loader-ellipsis,
|
|
14
|
-
:global(.
|
|
14
|
+
:global(.byline-loader-ellipsis) {
|
|
15
15
|
--_size: var(--loader-ellipsis-size, 80px);
|
|
16
16
|
--_color: var(--loader-ellipsis-color, var(--loader-color, currentColor));
|
|
17
17
|
display: inline-block;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.loader-ellipsis-dot,
|
|
24
|
-
:global(.
|
|
24
|
+
:global(.byline-loader-ellipsis-dot) {
|
|
25
25
|
position: absolute;
|
|
26
26
|
top: 41.25%;
|
|
27
27
|
width: 16.25%;
|
package/src/loaders/ellipses.tsx
CHANGED
|
@@ -27,13 +27,13 @@ export function LoaderEllipsis({
|
|
|
27
27
|
<div
|
|
28
28
|
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
29
29
|
key={index}
|
|
30
|
-
className={cx('
|
|
30
|
+
className={cx('byline-loader-ellipsis-dot', styles['loader-ellipsis-dot'])}
|
|
31
31
|
/>
|
|
32
32
|
))
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<div
|
|
36
|
-
className={cx('
|
|
36
|
+
className={cx('byline-loader-ellipsis', styles['loader-ellipsis'], className)}
|
|
37
37
|
style={ellipsisStyle}
|
|
38
38
|
{...rest}
|
|
39
39
|
>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
@layer byline-components {
|
|
13
13
|
.loader-ring,
|
|
14
|
-
:global(.
|
|
14
|
+
:global(.byline-loader-ring) {
|
|
15
15
|
--_size: var(--loader-ring-size, 60px);
|
|
16
16
|
--_color: var(--loader-ring-color, var(--loader-color, currentColor));
|
|
17
17
|
display: inline-block;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.loader-ring-arc,
|
|
24
|
-
:global(.
|
|
24
|
+
:global(.byline-loader-ring-arc) {
|
|
25
25
|
box-sizing: border-box;
|
|
26
26
|
display: block;
|
|
27
27
|
position: absolute;
|
package/src/loaders/ring.tsx
CHANGED
|
@@ -28,14 +28,14 @@ export function LoaderRing({
|
|
|
28
28
|
<div
|
|
29
29
|
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
30
30
|
key={index}
|
|
31
|
-
className={cx('
|
|
31
|
+
className={cx('byline-loader-ring-arc', styles['loader-ring-arc'])}
|
|
32
32
|
/>
|
|
33
33
|
)
|
|
34
34
|
})
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
37
|
<div
|
|
38
|
-
className={cx('
|
|
38
|
+
className={cx('byline-loader-ring', styles['loader-ring'], className)}
|
|
39
39
|
style={ringStyle}
|
|
40
40
|
{...rest}
|
|
41
41
|
>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
@layer byline-components {
|
|
13
13
|
.loader-spinner,
|
|
14
|
-
:global(.
|
|
14
|
+
:global(.byline-loader-spinner) {
|
|
15
15
|
--_size: var(--loader-spinner-size, 56px);
|
|
16
16
|
--_color: var(--loader-spinner-color, var(--loader-color, currentColor));
|
|
17
17
|
display: inline-block;
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.loader-spinner-blade,
|
|
24
|
-
:global(.
|
|
24
|
+
:global(.byline-loader-spinner-blade) {
|
|
25
25
|
transform-origin: calc(var(--_size) * 0.5) calc(var(--_size) * 0.5714);
|
|
26
26
|
animation: loader-spinner 1.2s linear infinite;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.loader-spinner-blade-inner,
|
|
30
|
-
:global(.
|
|
30
|
+
:global(.byline-loader-spinner-blade-inner) {
|
|
31
31
|
display: block;
|
|
32
32
|
position: absolute;
|
|
33
33
|
top: 0;
|