@ostack.tech/ui 1.2.0 → 1.3.0-beta.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/dist/ostack-ui.css +867 -240
- package/dist/ostack-ui.js +8739 -6422
- package/dist/ostack-ui.js.map +1 -1
- package/package.json +1 -1
- package/scss/_utils.scss +2 -1
- package/scss/components/ButtonGroup/_ButtonGroup.scss +7 -4
- package/scss/components/Calendar/_Calendar.scss +0 -1
- package/scss/components/Card/_Card.scss +16 -7
- package/scss/components/Code/_Code.scss +3 -3
- package/scss/components/Container/_Container.scss +3 -3
- package/scss/components/ControlCode/_ControlCode.scss +1 -1
- package/scss/components/DataTable/_DataTable.scss +8 -8
- package/scss/components/DescriptionList/_DescriptionList.scss +1 -1
- package/scss/components/Feedback/_Feedback.scss +12 -9
- package/scss/components/Field/_Field.scss +3 -3
- package/scss/components/FieldGroup/_FieldGroup.scss +2 -1
- package/scss/components/Form/_Form.scss +2 -2
- package/scss/components/Grid/_Grid.scss +11 -11
- package/scss/components/Heading/_Heading-variables.scss +4 -1
- package/scss/components/Heading/_Heading.scss +22 -10
- package/scss/components/HelperText/_HelperText.scss +9 -7
- package/scss/components/Icon/_Icon-variables.scss +1 -0
- package/scss/components/Icon/_Icon.scss +2 -6
- package/scss/components/Keyboard/_Keyboard-variables.scss +4 -2
- package/scss/components/Keyboard/_Keyboard.scss +8 -4
- package/scss/components/Label/_Label-variables.scss +4 -0
- package/scss/components/Label/_Label.scss +13 -4
- package/scss/components/Link/_Link-variables.scss +1 -1
- package/scss/components/Link/_Link.scss +12 -3
- package/scss/components/Mark/_Mark.scss +2 -1
- package/scss/components/Spinner/_Spinner-variables.scss +1 -1
- package/scss/components/Spinner/_Spinner.scss +0 -7
- package/scss/components/Stack/_Stack.scss +20 -10
- package/scss/components/Stepper/_Stepper-variables.scss +0 -4
- package/scss/components/Stepper/_Stepper.scss +1 -6
- package/scss/components/Tabs/_Tabs-variables.scss +0 -1
- package/scss/components/Tabs/_Tabs.scss +4 -3
- package/scss/components/Tag/_Tag-variables.scss +1 -0
- package/scss/components/Tag/_Tag.scss +4 -3
- package/scss/components/Text/_Text-variables.scss +4 -0
- package/scss/components/Text/_Text.scss +19 -0
- package/scss/index.scss +5 -0
- package/scss/scss/helpers/_margin-utils.scss +35 -0
- package/scss/scss/helpers/_padding-utils.scss +35 -0
- package/scss/scss/helpers/_print-utils.scss +1 -1
- package/scss/scss/helpers/_sizing-utils.scss +45 -0
- package/scss/scss/helpers/_text-utils.scss +43 -0
- package/scss/scss/placeholders/checkable-group/_checkable-group.scss +2 -2
- package/scss/scss/placeholders/control/_control.scss +1 -9
- package/scss/scss/placeholders/menu/_menu.scss +2 -1
- package/scss/scss/placeholders/popover/_popover.scss +2 -2
- package/scss/scss/utils/_responsive-values.scss +7 -8
- package/types/components/Actions/Action.d.ts +1 -1
- package/types/components/Actions/Actions.d.ts +1 -1
- package/types/components/Alert/Alert.d.ts +3 -2
- package/types/components/Box/Box.d.ts +37 -0
- package/types/components/Box/index.d.ts +1 -0
- package/types/components/Button/Button.d.ts +3 -2
- package/types/components/ButtonGroup/ButtonGroup.d.ts +3 -2
- package/types/components/Calendar/Calendar.d.ts +3 -2
- package/types/components/Card/Card.d.ts +3 -2
- package/types/components/Card/CardTitle.d.ts +3 -2
- package/types/components/Checkbox/Checkbox.d.ts +2 -1
- package/types/components/CheckboxGroup/CheckboxGroup.d.ts +3 -2
- package/types/components/Code/Code.d.ts +4 -2
- package/types/components/Container/Container.d.ts +3 -2
- package/types/components/Control/Control.d.ts +13 -13
- package/types/components/ControlCode/ControlCode.d.ts +3 -2
- package/types/components/DataTable/DataTablePagination.d.ts +3 -2
- package/types/components/DataTable/DataTableRowsPerPage.d.ts +3 -2
- package/types/components/DateRangeInput/DateRangeInput.d.ts +5 -6
- package/types/components/Feedback/Feedback.d.ts +6 -4
- package/types/components/Feedback/FeedbackList.d.ts +3 -2
- package/types/components/Field/Field.d.ts +5 -10
- package/types/components/FieldGroup/FieldGroup.d.ts +3 -2
- package/types/components/FieldGroup/FieldGroupTitle.d.ts +3 -2
- package/types/components/Form/Form.d.ts +3 -8
- package/types/components/Grid/Grid.d.ts +4 -4
- package/types/components/Grid/GridContext.d.ts +1 -1
- package/types/components/Heading/Heading.d.ts +12 -3
- package/types/components/HelperText/HelperText.d.ts +4 -2
- package/types/components/Icon/Icon.d.ts +9 -4
- package/types/components/IconButton/IconButton.d.ts +3 -2
- package/types/components/Keybinds/Keybinds.d.ts +3 -2
- package/types/components/Keyboard/Keyboard.d.ts +17 -4
- package/types/components/Label/Label.d.ts +11 -2
- package/types/components/Link/Link.d.ts +4 -2
- package/types/components/Mark/Mark.d.ts +7 -5
- package/types/components/MenuList/MenuList.d.ts +3 -2
- package/types/components/Popover/Popover.d.ts +1 -1
- package/types/components/Popover/PopoverContent.d.ts +4 -2
- package/types/components/Printer/PrinterContent.d.ts +3 -9
- package/types/components/RadioGroup/Radio.d.ts +2 -1
- package/types/components/RadioGroup/RadioGroup.d.ts +3 -2
- package/types/components/Root/Root.d.ts +3 -8
- package/types/components/Root/RootElement.d.ts +2 -2
- package/types/components/Separator/Separator.d.ts +2 -1
- package/types/components/Spinner/Spinner.d.ts +7 -4
- package/types/components/Stack/Stack.d.ts +5 -10
- package/types/components/Stack/StackContext.d.ts +1 -1
- package/types/components/Stepper/StepContent.d.ts +3 -8
- package/types/components/Stepper/StepList.d.ts +3 -2
- package/types/components/Stepper/Stepper.d.ts +9 -13
- package/types/components/Table/Table.d.ts +2 -1
- package/types/components/Tabs/TabContent.d.ts +3 -2
- package/types/components/Tabs/TabList.d.ts +2 -1
- package/types/components/Tabs/Tabs.d.ts +6 -4
- package/types/components/Tag/Tag.d.ts +4 -2
- package/types/components/Text/Text.d.ts +48 -0
- package/types/components/Text/index.d.ts +1 -0
- package/types/index.d.ts +7 -1
- package/types/utils/responsiveValues.d.ts +41 -0
- package/types/utils/useMarginProps.d.ts +46 -0
- package/types/utils/usePaddingProps.d.ts +46 -0
- package/types/utils/useSizingProps.d.ts +23 -0
- package/types/utils/useTextProps.d.ts +50 -0
- package/types/utils/changeCase.d.ts +0 -2
- package/types/utils/useResponsiveValues.d.ts +0 -41
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
@use "../../scss/utils/responsive-values" as *;
|
|
5
5
|
|
|
6
6
|
.#{$prefix}stack {
|
|
7
|
-
$stack: &;
|
|
8
|
-
|
|
9
7
|
display: flex;
|
|
10
8
|
flex-direction: var(--#{$prefix}stack-direction);
|
|
11
9
|
justify-content: var(--#{$prefix}stack-justify-content);
|
|
@@ -15,11 +13,14 @@
|
|
|
15
13
|
|
|
16
14
|
// Handle responsive values
|
|
17
15
|
@include responsive-values(
|
|
18
|
-
|
|
16
|
+
#{$prefix}stack-,
|
|
19
17
|
(
|
|
20
18
|
direction: column,
|
|
21
19
|
gap: $stack-default-gap,
|
|
22
|
-
child-
|
|
20
|
+
child-mt: var(--#{$prefix}stack-gap),
|
|
21
|
+
child-mr: 0px,
|
|
22
|
+
child-mb: 0px,
|
|
23
|
+
child-ml: 0px,
|
|
23
24
|
justify-content: null,
|
|
24
25
|
align-items: null,
|
|
25
26
|
align-content: null,
|
|
@@ -28,19 +29,28 @@
|
|
|
28
29
|
);
|
|
29
30
|
|
|
30
31
|
// Handle margins of non-stack children
|
|
31
|
-
& > :not(style) + :not(style):not(
|
|
32
|
-
margin: var(--#{$prefix}stack-child-
|
|
32
|
+
& > :not(style) + :not(style):not(&) {
|
|
33
|
+
margin: calc(var(--#{$prefix}mt, 0px) + var(--#{$prefix}stack-child-mt))
|
|
34
|
+
calc(var(--#{$prefix}mr, 0px) + var(--#{$prefix}stack-child-mr))
|
|
35
|
+
calc(var(--#{$prefix}mb, 0px) + var(--#{$prefix}stack-child-mb))
|
|
36
|
+
calc(var(--#{$prefix}ml, 0px) + var(--#{$prefix}stack-child-ml));
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
// Handle margins of stack children
|
|
36
|
-
& > :not(style) +
|
|
37
|
-
margin: var(--#{$prefix}stack-ancestor-child-
|
|
40
|
+
& > :not(style) + & {
|
|
41
|
+
margin: calc(var(--#{$prefix}mt, 0px) + var(--#{$prefix}stack-ancestor-child-mt))
|
|
42
|
+
calc(var(--#{$prefix}mr, 0px) + var(--#{$prefix}stack-ancestor-child-mr))
|
|
43
|
+
calc(var(--#{$prefix}mb, 0px) + var(--#{$prefix}stack-ancestor-child-mb))
|
|
44
|
+
calc(var(--#{$prefix}ml, 0px) + var(--#{$prefix}stack-ancestor-child-ml));
|
|
38
45
|
|
|
39
46
|
@include responsive-values(
|
|
40
|
-
|
|
47
|
+
#{$prefix}stack-,
|
|
41
48
|
(
|
|
42
49
|
ancestor-gap: $stack-default-gap,
|
|
43
|
-
ancestor-child-
|
|
50
|
+
ancestor-child-mt: var(--#{$prefix}stack-ancestor-gap),
|
|
51
|
+
ancestor-child-mr: 0px,
|
|
52
|
+
ancestor-child-mb: 0px,
|
|
53
|
+
ancestor-child-ml: 0px,
|
|
44
54
|
)
|
|
45
55
|
);
|
|
46
56
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
@use "../../scss/base-variables" as *;
|
|
2
2
|
@use "../../scss/utils/spacing" as *;
|
|
3
3
|
|
|
4
|
-
// Step list
|
|
5
|
-
$stepper-step-list-margin-y: spacing(2) !default;
|
|
6
|
-
|
|
7
4
|
// Step
|
|
8
5
|
$stepper-step-size: 30px !default;
|
|
9
6
|
$stepper-step-border-radius: 50% !default;
|
|
@@ -29,7 +26,6 @@ $stepper-step-line-completed-background-color: var(--#{$prefix}primary-a9) !defa
|
|
|
29
26
|
$stepper-step-line-completed-status-background-color: var(--#{$prefix}accent-a9) !default;
|
|
30
27
|
|
|
31
28
|
// Step content label
|
|
32
|
-
$stepper-step-content-label-margin-bottom: spacing(1.5) !default;
|
|
33
29
|
$stepper-step-content-label-font-size: var(--#{$prefix}font-size-sm) !default;
|
|
34
30
|
$stepper-step-content-label-line-height: var(--#{$prefix}font-size-sm) !default;
|
|
35
31
|
$stepper-step-content-label-font-weight: $font-weight-medium !default;
|
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
padding: 0;
|
|
15
15
|
display: flex;
|
|
16
16
|
justify-content: center;
|
|
17
|
-
|
|
18
|
-
&:not(:last-child) {
|
|
19
|
-
margin-bottom: $stepper-step-list-margin-y;
|
|
20
|
-
}
|
|
21
17
|
}
|
|
22
18
|
|
|
23
19
|
&__step {
|
|
@@ -78,7 +74,6 @@
|
|
|
78
74
|
display: inline-flex;
|
|
79
75
|
align-items: center;
|
|
80
76
|
|
|
81
|
-
margin-bottom: $stepper-step-content-label-margin-bottom;
|
|
82
77
|
font-size: $stepper-step-content-label-font-size;
|
|
83
78
|
line-height: $stepper-step-content-label-line-height;
|
|
84
79
|
font-weight: $stepper-step-content-label-font-weight;
|
|
@@ -96,7 +91,7 @@
|
|
|
96
91
|
}
|
|
97
92
|
|
|
98
93
|
&__step-content {
|
|
99
|
-
width: 100
|
|
94
|
+
width: var(--#{$prefix}w, 100%);
|
|
100
95
|
|
|
101
96
|
&:focus-visible {
|
|
102
97
|
outline: $stepper-step-content-focus-outline-width solid
|
|
@@ -182,7 +182,6 @@ $tabs-tab-content-label-padding-y: calc(
|
|
|
182
182
|
$tabs-tab-content-label-padding-x: calc(
|
|
183
183
|
$tabs-tab-default-padding-x + $tabs-tab-inner-default-padding-x
|
|
184
184
|
) !default;
|
|
185
|
-
$tabs-tab-content-label-margin-bottom: spacing(1.5) !default;
|
|
186
185
|
$tabs-tab-content-label-border-bottom: 2px solid var(--#{$prefix}primary-9) !default;
|
|
187
186
|
$tabs-tab-content-label-font-size: var(--#{$prefix}font-size-sm) !default;
|
|
188
187
|
$tabs-tab-content-label-line-height: var(--#{$prefix}font-size-sm) !default;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
.#{$prefix}tabs {
|
|
11
11
|
display: block;
|
|
12
|
-
min-width: 0;
|
|
12
|
+
min-width: var(--#{$prefix}min-w, 0);
|
|
13
13
|
|
|
14
14
|
@each $variant in $tabs-variants {
|
|
15
15
|
&--#{$variant} {
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
// Tab list
|
|
33
33
|
&__tab-list-root {
|
|
34
34
|
display: flex;
|
|
35
|
-
margin-bottom:
|
|
35
|
+
margin-bottom: calc(
|
|
36
|
+
var(--#{$prefix}mb, 0px) + var(--#{$prefix}tabs-tab-list-margin-bottom, 0px)
|
|
37
|
+
);
|
|
36
38
|
box-shadow: var(--#{$prefix}tabs-tab-list-box-shadow);
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -414,7 +416,6 @@
|
|
|
414
416
|
&__tab-content-label {
|
|
415
417
|
display: inline-flex;
|
|
416
418
|
|
|
417
|
-
margin-bottom: $tabs-tab-content-label-margin-bottom;
|
|
418
419
|
padding: $tabs-tab-content-label-padding-y $tabs-tab-content-label-padding-x;
|
|
419
420
|
border-bottom: $tabs-tab-content-label-border-bottom;
|
|
420
421
|
font-size: $tabs-tab-content-label-font-size;
|
|
@@ -8,6 +8,7 @@ $tag-font-size: 0.75em !default;
|
|
|
8
8
|
$tag-line-height: 1.25 !default;
|
|
9
9
|
$tag-font-weight: $font-weight-medium !default;
|
|
10
10
|
$tag-text-transform: null !default;
|
|
11
|
+
$tag-text-align: center !default;
|
|
11
12
|
$tag-animation-duration: 0.15s !default;
|
|
12
13
|
$tag-animation-timing-function: ease !default;
|
|
13
14
|
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
padding: $tag-padding-y $tag-padding-x;
|
|
16
16
|
border-radius: $tag-border-radius;
|
|
17
17
|
|
|
18
|
-
font-size: $tag-font-size;
|
|
19
|
-
line-height: $tag-line-height;
|
|
20
|
-
font-weight: $tag-font-weight;
|
|
18
|
+
font-size: var(--#{$prefix}font-size, $tag-font-size);
|
|
19
|
+
line-height: var(--#{$prefix}line-height, $tag-line-height);
|
|
20
|
+
font-weight: var(--#{$prefix}font-weight, $tag-font-weight);
|
|
21
21
|
text-transform: $tag-text-transform;
|
|
22
|
+
text-align: var(--#{$prefix}text-align, $tag-text-align);
|
|
22
23
|
|
|
23
24
|
background-color: var(--#{$prefix}tag-background-color);
|
|
24
25
|
color: var(--#{$prefix}tag-color);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use "Text-variables" as *;
|
|
2
|
+
@use "../../scss/base-variables" as *;
|
|
3
|
+
@use "../../scss/utils/responsive-values" as *;
|
|
4
|
+
|
|
5
|
+
.#{$prefix}text {
|
|
6
|
+
// Accent
|
|
7
|
+
&[data-accent] {
|
|
8
|
+
color: $text-accent-color;
|
|
9
|
+
}
|
|
10
|
+
&--high-contrast[data-accent] {
|
|
11
|
+
color: $text-high-contrast-accent-color;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Paragraph
|
|
15
|
+
&:is(p) {
|
|
16
|
+
margin-top: var(--#{$prefix}mt, 0);
|
|
17
|
+
margin-bottom: var(--#{$prefix}mb, 0);
|
|
18
|
+
}
|
|
19
|
+
}
|
package/scss/index.scss
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
// Helpers
|
|
4
4
|
@forward "scss/helpers/keyframes";
|
|
5
|
+
@forward "scss/helpers/margin-utils";
|
|
6
|
+
@forward "scss/helpers/padding-utils";
|
|
5
7
|
@forward "scss/helpers/print-utils";
|
|
8
|
+
@forward "scss/helpers/sizing-utils";
|
|
9
|
+
@forward "scss/helpers/text-utils";
|
|
6
10
|
@forward "scss/helpers/visually-hidden";
|
|
7
11
|
|
|
8
12
|
// Components
|
|
@@ -56,5 +60,6 @@
|
|
|
56
60
|
@forward "components/Table/Table";
|
|
57
61
|
@forward "components/Tabs/Tabs";
|
|
58
62
|
@forward "components/Tag/Tag";
|
|
63
|
+
@forward "components/Text/Text";
|
|
59
64
|
@forward "components/Toast/Toast";
|
|
60
65
|
@forward "components/Tooltip/Tooltip";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@use "../base-variables" as *;
|
|
2
|
+
@use "../utils/responsive-values" as *;
|
|
3
|
+
|
|
4
|
+
@each $prop in (mt, mr, mb, ml) {
|
|
5
|
+
@property --#{$prefix}#{$prop} {
|
|
6
|
+
syntax: "*";
|
|
7
|
+
inherits: false;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@include responsive-values(
|
|
12
|
+
$prefix,
|
|
13
|
+
(
|
|
14
|
+
mt: null,
|
|
15
|
+
mr: null,
|
|
16
|
+
mb: null,
|
|
17
|
+
ml: null,
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
[data-has-mt] {
|
|
22
|
+
margin-top: var(--#{$prefix}mt);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[data-has-mr] {
|
|
26
|
+
margin-right: var(--#{$prefix}mr);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-has-mb] {
|
|
30
|
+
margin-bottom: var(--#{$prefix}mb);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[data-has-ml] {
|
|
34
|
+
margin-left: var(--#{$prefix}ml);
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@use "../base-variables" as *;
|
|
2
|
+
@use "../utils/responsive-values" as *;
|
|
3
|
+
|
|
4
|
+
@each $prop in (pt, pr, pb, pl) {
|
|
5
|
+
@property --#{$prefix}#{$prop} {
|
|
6
|
+
syntax: "*";
|
|
7
|
+
inherits: false;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@include responsive-values(
|
|
12
|
+
$prefix,
|
|
13
|
+
(
|
|
14
|
+
pt: null,
|
|
15
|
+
pr: null,
|
|
16
|
+
pb: null,
|
|
17
|
+
pl: null,
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
[data-has-pt] {
|
|
22
|
+
padding-top: var(--#{$prefix}pt);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[data-has-pr] {
|
|
26
|
+
padding-right: var(--#{$prefix}pr);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-has-pb] {
|
|
30
|
+
padding-bottom: var(--#{$prefix}pb);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[data-has-pl] {
|
|
34
|
+
padding-left: var(--#{$prefix}pl);
|
|
35
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use "../base-variables" as *;
|
|
2
|
+
@use "../utils/responsive-values" as *;
|
|
3
|
+
|
|
4
|
+
@each $prop in (w, min-w, max-w, h, min-h, max-h) {
|
|
5
|
+
@property --#{$prefix}#{$prop} {
|
|
6
|
+
syntax: "*";
|
|
7
|
+
inherits: false;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@include responsive-values(
|
|
12
|
+
$prefix,
|
|
13
|
+
(
|
|
14
|
+
w: null,
|
|
15
|
+
min-w: null,
|
|
16
|
+
max-w: null,
|
|
17
|
+
h: null,
|
|
18
|
+
min-h: null,
|
|
19
|
+
max-h: null,
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
[data-has-w] {
|
|
24
|
+
width: var(--#{$prefix}w);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-has-min-w] {
|
|
28
|
+
min-width: var(--#{$prefix}min-w);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-has-max-w] {
|
|
32
|
+
max-width: var(--#{$prefix}max-w);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-has-h] {
|
|
36
|
+
height: var(--#{$prefix}h);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-has-min-h] {
|
|
40
|
+
min-height: var(--#{$prefix}min-h);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[data-has-max-h] {
|
|
44
|
+
max-height: var(--#{$prefix}max-h);
|
|
45
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@use "../base-variables" as *;
|
|
2
|
+
@use "../utils/responsive-values" as *;
|
|
3
|
+
|
|
4
|
+
@each $prop in (font-size, line-height, text-align, font-weight, text-wrap) {
|
|
5
|
+
@property --#{$prefix}#{$prop} {
|
|
6
|
+
syntax: "*";
|
|
7
|
+
inherits: false;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@include responsive-values(
|
|
12
|
+
$prefix,
|
|
13
|
+
(
|
|
14
|
+
font-size: null,
|
|
15
|
+
line-height: null,
|
|
16
|
+
text-align: null,
|
|
17
|
+
font-weight: null,
|
|
18
|
+
text-wrap: null,
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
[data-text-truncate] {
|
|
23
|
+
text-overflow: ellipsis;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[data-has-text-size] {
|
|
29
|
+
font-size: var(--#{$prefix}font-size);
|
|
30
|
+
line-height: var(--#{$prefix}line-height);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[data-has-text-align] {
|
|
34
|
+
text-align: var(--#{$prefix}text-align);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[data-has-font-weight] {
|
|
38
|
+
font-weight: var(--#{$prefix}font-weight);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[data-has-text-wrap] {
|
|
42
|
+
text-wrap: var(--#{$prefix}text-wrap);
|
|
43
|
+
}
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
// Add margin between checkables
|
|
80
80
|
&__checkable--not-first {
|
|
81
81
|
&--block {
|
|
82
|
-
margin-top: $checkable-group-block-margin-y;
|
|
82
|
+
margin-top: var(--#{$prefix}mt, $checkable-group-block-margin-y);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
&--inline {
|
|
86
|
-
margin-left: $checkable-group-inline-margin-x;
|
|
86
|
+
margin-left: var(--#{$prefix}ml, $checkable-group-inline-margin-x);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -23,20 +23,12 @@
|
|
|
23
23
|
font-family: $control-font-family;
|
|
24
24
|
font-size: inherit;
|
|
25
25
|
line-height: inherit;
|
|
26
|
-
text-align: var(--#{$prefix}
|
|
26
|
+
text-align: var(--#{$prefix}text-align, inherit);
|
|
27
27
|
font-weight: $control-font-weight;
|
|
28
28
|
|
|
29
29
|
color: inherit;
|
|
30
30
|
background-color: transparent;
|
|
31
31
|
|
|
32
|
-
// Handle responsive values
|
|
33
|
-
@include responsive-values(
|
|
34
|
-
--#{$prefix}control,
|
|
35
|
-
(
|
|
36
|
-
align: inherit,
|
|
37
|
-
)
|
|
38
|
-
);
|
|
39
|
-
|
|
40
32
|
// Border radius
|
|
41
33
|
&:first-child {
|
|
42
34
|
border-top-left-radius: var(--#{$prefix}control-border-radius);
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
%#{$prefix}popover {
|
|
8
8
|
$popover: &;
|
|
9
9
|
|
|
10
|
-
max-width: var(--radix-popover-content-available-width);
|
|
11
|
-
max-height: var(--radix-popover-content-available-height);
|
|
10
|
+
max-width: var(--#{$prefix}max-w, var(--radix-popover-content-available-width));
|
|
11
|
+
max-height: var(--#{$prefix}max-h, var(--radix-popover-content-available-height));
|
|
12
12
|
|
|
13
13
|
border: $popover-border-width solid $popover-border-color;
|
|
14
14
|
border-radius: $popover-border-radius;
|
|
@@ -3,22 +3,21 @@
|
|
|
3
3
|
@use "breakpoints" as *;
|
|
4
4
|
@use "declare-var" as *;
|
|
5
5
|
|
|
6
|
-
// Mixin that sets CSS variables for a component with the given name that
|
|
7
|
-
//
|
|
8
|
-
// CSS variable has name `#{$var-prefix}-#{$prop}`.
|
|
6
|
+
// Mixin that sets CSS variables for a component with the given name that changes their value based
|
|
7
|
+
// on the current breakpoint. The currently "active" CSS variable has name `#{$var-prefix}#{$prop}`.
|
|
9
8
|
//
|
|
10
9
|
// This mixin assumes the existence of css variables with names
|
|
11
|
-
// `#{$var-prefix}
|
|
10
|
+
// `#{$var-prefix}#{$prop}-#{$breakpoint}` and data attributes of name
|
|
12
11
|
// `data-has-#{$prop}-#{breakpoint}`.
|
|
13
|
-
@mixin responsive-values($
|
|
12
|
+
@mixin responsive-values($prefix, $props) {
|
|
14
13
|
@each $prop, $default-value in $props {
|
|
15
|
-
@include declare-var(
|
|
14
|
+
@include declare-var(--#{$prefix}#{$prop}, $default-value);
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
@include each-breakpoint-up using ($size) {
|
|
19
18
|
@each $prop in map.keys($props) {
|
|
20
|
-
&[data-has-#{$prop}-#{$size}] {
|
|
21
|
-
@include declare-var(
|
|
19
|
+
@at-root #{if(sass(&): &; else: "")}[data-has-#{$prop}-#{$size}] {
|
|
20
|
+
@include declare-var(--#{$prefix}#{$prop}, var(--#{$prefix}#{$prop}-#{$size}));
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode, Ref } from "react";
|
|
2
|
-
import { type Responsive } from "../../utils/
|
|
2
|
+
import { type Responsive } from "../../utils/responsiveValues.ts";
|
|
3
3
|
import { type ButtonProps } from "../Button";
|
|
4
4
|
import { type IconButtonProps } from "../IconButton";
|
|
5
5
|
/** Supported action layouts. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps } from "react";
|
|
2
|
-
import { type Responsive } from "../../utils/
|
|
2
|
+
import { type Responsive } from "../../utils/responsiveValues.ts";
|
|
3
3
|
import { type StackProps } from "../Stack";
|
|
4
4
|
import type { ActionLayout } from "./Action.tsx";
|
|
5
5
|
/** Layout for primary actions. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
|
|
2
3
|
import { type CloseButtonProps } from "../CloseButton";
|
|
3
4
|
import { type CollapsibleContentProps } from "../Collapsible";
|
|
4
5
|
import { type IconProp, type IconProps } from "../Icon";
|
|
@@ -9,7 +10,7 @@ export type AlertSeverity = "neutral" | "info" | "success" | "danger" | "warning
|
|
|
9
10
|
/** Alert type of announcement. */
|
|
10
11
|
export type AlertAnnounce = "off" | "polite" | "assertive";
|
|
11
12
|
/** Properties of the alert component. */
|
|
12
|
-
export interface AlertProps extends ComponentProps<"div"> {
|
|
13
|
+
export interface AlertProps extends UseMarginPropsOptions, ComponentProps<"div"> {
|
|
13
14
|
/**
|
|
14
15
|
* Alert variant.
|
|
15
16
|
*
|
|
@@ -92,4 +93,4 @@ export interface AlertProps extends ComponentProps<"div"> {
|
|
|
92
93
|
* }
|
|
93
94
|
* ```
|
|
94
95
|
*/
|
|
95
|
-
export declare function Alert({ variant, severity, announce, defaultOpen, open, onOpenChange, icon, showCloseButton, action, containerProps, iconProps, contentProps, actionContainerProps, closeButtonProps, children, className, role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...otherProps }: AlertProps): import("react").JSX.Element;
|
|
96
|
+
export declare function Alert({ variant, severity, announce, defaultOpen, open, onOpenChange, icon, showCloseButton, action, containerProps, iconProps, contentProps, actionContainerProps, closeButtonProps, children, className, style, role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...otherProps }: AlertProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
|
|
2
|
+
import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
|
|
3
|
+
import { type UsePaddingPropsOptions } from "../../utils/usePaddingProps.ts";
|
|
4
|
+
import { type UseSizingPropsOptions } from "../../utils/useSizingProps.ts";
|
|
5
|
+
/** Elements a box can be rendered as. */
|
|
6
|
+
export type BoxAs = "div" | "span";
|
|
7
|
+
/** Properties of the box component. */
|
|
8
|
+
export type BoxProps<TAs extends BoxAs = "div"> = PolymorphicProps<BoxAs, TAs, "div", BoxOwnProps>;
|
|
9
|
+
/** Own properties of the box component. */
|
|
10
|
+
export interface BoxOwnProps extends UseMarginPropsOptions, UsePaddingPropsOptions, UseSizingPropsOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
13
|
+
* original component props with the props of the supplied element/component and change the
|
|
14
|
+
* underlying DOM node.
|
|
15
|
+
*/
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Basic layout component. Built on top of the browser's [`<div>`
|
|
20
|
+
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/div) with access to
|
|
21
|
+
* margin, padding, sizing, and other layout-related properties.
|
|
22
|
+
*
|
|
23
|
+
* Example usage:
|
|
24
|
+
*
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { Box } from "@ostack.tech/ui";
|
|
27
|
+
*
|
|
28
|
+
* function WrappedItem() {
|
|
29
|
+
* return (
|
|
30
|
+
* <Box width={64} height={64}>
|
|
31
|
+
* <Item />
|
|
32
|
+
* </Box>
|
|
33
|
+
* );
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function Box<TAs extends BoxAs = "div">({ as, asChild, style, ...otherProps }: BoxProps<TAs>): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Box.tsx";
|
|
@@ -2,6 +2,7 @@ import { type ReactElement, type ReactNode } from "react";
|
|
|
2
2
|
import type { AccentColor } from "../../utils/accent.ts";
|
|
3
3
|
import { type KeyboardShortcutKeybinds } from "../../utils/keyboardShortcut.ts";
|
|
4
4
|
import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
|
|
5
|
+
import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
|
|
5
6
|
import { type IconProp, type IconProps } from "../Icon";
|
|
6
7
|
import { type KeybindsProps } from "../Keybinds";
|
|
7
8
|
import { type SpinnerProps } from "../Spinner";
|
|
@@ -19,7 +20,7 @@ export type ButtonIconPlacement = "start" | "end";
|
|
|
19
20
|
/** Properties of the button component. */
|
|
20
21
|
export type ButtonProps<TAs extends ButtonAs = "button"> = PolymorphicProps<ButtonAs, TAs, "button", ButtonOwnProps>;
|
|
21
22
|
/** Own properties of the button component. */
|
|
22
|
-
export interface ButtonOwnProps {
|
|
23
|
+
export interface ButtonOwnProps extends UseMarginPropsOptions {
|
|
23
24
|
/**
|
|
24
25
|
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
25
26
|
* original component props with the props of the supplied element/component and change the
|
|
@@ -151,4 +152,4 @@ export interface ButtonOwnProps {
|
|
|
151
152
|
* }
|
|
152
153
|
* ```
|
|
153
154
|
*/
|
|
154
|
-
export declare function Button<TAs extends ButtonAs = "button">({ as, asChild, variant, color, size, vertical, icon, iconPlacement, active, disabled, loading, loadingContent, showSpinner, tooltipContent, keybinds, iconProps, spinnerProps, tooltipProps, keybindsProps, type, onClick, className, children, "aria-disabled": ariaDisabled, ...otherProps }: ButtonProps<TAs>): import("react").JSX.Element;
|
|
155
|
+
export declare function Button<TAs extends ButtonAs = "button">({ as, asChild, variant, color, size, vertical, icon, iconPlacement, active, disabled, loading, loadingContent, showSpinner, tooltipContent, keybinds, iconProps, spinnerProps, tooltipProps, keybindsProps, type, onClick, className, style, children, "aria-disabled": ariaDisabled, ...otherProps }: ButtonProps<TAs>): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
|
|
2
3
|
/** Properties of the button group component. */
|
|
3
|
-
export interface ButtonGroupProps extends ComponentProps<"div"> {
|
|
4
|
+
export interface ButtonGroupProps extends UseMarginPropsOptions, ComponentProps<"div"> {
|
|
4
5
|
/**
|
|
5
6
|
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
6
7
|
* original component props with the props of the supplied element/component and change the
|
|
@@ -31,4 +32,4 @@ export interface ButtonGroupProps extends ComponentProps<"div"> {
|
|
|
31
32
|
* }
|
|
32
33
|
* ```
|
|
33
34
|
*/
|
|
34
|
-
export declare function ButtonGroup({ asChild, label, className, children, ...otherProps }: ButtonGroupProps): import("react").JSX.Element;
|
|
35
|
+
export declare function ButtonGroup({ asChild, label, className, style, children, ...otherProps }: ButtonGroupProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type DayPickerProps } from "@daypicker/react";
|
|
2
2
|
import { type ComponentProps, type RefObject } from "react";
|
|
3
|
+
import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
|
|
3
4
|
import type { IconButtonProps } from "../IconButton";
|
|
4
5
|
import type { SelectSingleProps } from "../Select";
|
|
5
6
|
/** Mode for selecting calendar dates. */
|
|
@@ -33,7 +34,7 @@ export interface CalendarApi<TValue extends Date | Date[] | DateRange | null = D
|
|
|
33
34
|
/** Properties of the calendar component. */
|
|
34
35
|
export type CalendarProps = CalendarNoneSelectionProps | CalendarSingleSelectionProps | CalendarMultipleSelectionProps | CalendarRangeSelectionProps;
|
|
35
36
|
/** Base properties of the calendar component. */
|
|
36
|
-
export interface CalendarPropsBase<TValue extends Date | Date[] | DateRange | null = Date | Date[] | DateRange | null> extends Pick<DayPickerProps, "required" | "className" | "style" | "id" | "numberOfMonths" | "pagedNavigation" | "disableNavigation" | "fixedWeeks" | "hideWeekdays" | "showOutsideDays" | "showWeekNumber" | "broadcastCalendar" | "ISOWeek" | "timeZone" | "noonSafe" | "footer" | "autoFocus" | "disabled" | "hidden" | "today" | "modifiers" | "aria-label" | "aria-labelledby" | "numerals" | "weekStartsOn" | "firstWeekContainsDate" | "useAdditionalWeekYearTokens" | "useAdditionalDayOfYearTokens" | "onMonthChange" | "onNextClick" | "onPrevClick" | "onDayClick" | "onDayFocus" | "onDayBlur" | "onDayKeyDown" | "onDayMouseEnter" | "onDayMouseLeave"> {
|
|
37
|
+
export interface CalendarPropsBase<TValue extends Date | Date[] | DateRange | null = Date | Date[] | DateRange | null> extends UseMarginPropsOptions, Pick<DayPickerProps, "required" | "className" | "style" | "id" | "numberOfMonths" | "pagedNavigation" | "disableNavigation" | "fixedWeeks" | "hideWeekdays" | "showOutsideDays" | "showWeekNumber" | "broadcastCalendar" | "ISOWeek" | "timeZone" | "noonSafe" | "footer" | "autoFocus" | "disabled" | "hidden" | "today" | "modifiers" | "aria-label" | "aria-labelledby" | "numerals" | "weekStartsOn" | "firstWeekContainsDate" | "useAdditionalWeekYearTokens" | "useAdditionalDayOfYearTokens" | "onMonthChange" | "onNextClick" | "onPrevClick" | "onDayClick" | "onDayFocus" | "onDayBlur" | "onDayKeyDown" | "onDayMouseEnter" | "onDayMouseLeave"> {
|
|
37
38
|
/**
|
|
38
39
|
* Mode for selecting calendar dates.
|
|
39
40
|
*
|
|
@@ -114,4 +115,4 @@ export interface CalendarRangeSelectionProps extends CalendarPropsBase<DateRange
|
|
|
114
115
|
* }
|
|
115
116
|
* ```
|
|
116
117
|
*/
|
|
117
|
-
export declare function Calendar({ selectionMode, defaultValue, value: controlledValue, onValueChange, required, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, monthSelectLabel: monthSelectLabelProp, yearSelectLabel: yearSelectLabelProp, previousMonthLabel: previousMonthLabelProp, nextMonthLabel: nextMonthLabelProp, defaultMonth, month: controlledMonth, onMonthChange, onDayClick, onDayFocus, onDayMouseEnter, numberOfMonths, fixedWeeks, showOutsideDays, disableNavigation, disabled, modifiers, apiRef, headerProps, headerLabelProps, previousButtonProps, nextButtonProps, monthSelectProps, yearSelectProps, pagedNavigation, ...otherProps }: CalendarProps): import("react").JSX.Element;
|
|
118
|
+
export declare function Calendar({ selectionMode, defaultValue, value: controlledValue, onValueChange, required, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, monthSelectLabel: monthSelectLabelProp, yearSelectLabel: yearSelectLabelProp, previousMonthLabel: previousMonthLabelProp, nextMonthLabel: nextMonthLabelProp, defaultMonth, month: controlledMonth, onMonthChange, onDayClick, onDayFocus, onDayMouseEnter, numberOfMonths, fixedWeeks, showOutsideDays, disableNavigation, disabled, modifiers, apiRef, headerProps, headerLabelProps, previousButtonProps, nextButtonProps, monthSelectProps, yearSelectProps, pagedNavigation, style, ...otherProps }: CalendarProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ComponentProps } from "react";
|
|
2
2
|
import type { AccentColor } from "../../utils/accent.ts";
|
|
3
|
+
import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
|
|
3
4
|
/** Card variants. */
|
|
4
5
|
export type CardVariant = "solid" | "subtle" | "outlined" | "ghost";
|
|
5
6
|
/** Possible card colours. */
|
|
6
7
|
export type CardColor = AccentColor;
|
|
7
8
|
/** Properties of the card component. */
|
|
8
|
-
export interface CardProps extends ComponentProps<"div"> {
|
|
9
|
+
export interface CardProps extends UseMarginPropsOptions, ComponentProps<"div"> {
|
|
9
10
|
/**
|
|
10
11
|
* Change the component to the HTML tag or custom component of the only child. This will merge the
|
|
11
12
|
* original component props with the props of the supplied element/component and change the
|
|
@@ -60,4 +61,4 @@ export interface CardProps extends ComponentProps<"div"> {
|
|
|
60
61
|
* }
|
|
61
62
|
* ```
|
|
62
63
|
*/
|
|
63
|
-
export declare function Card({ asChild, variant, color, mergeSections, className, ...otherProps }: CardProps): import("react").JSX.Element;
|
|
64
|
+
export declare function Card({ asChild, variant, color, mergeSections, className, style, ...otherProps }: CardProps): import("react").JSX.Element;
|