@ostack.tech/ui 0.10.0 → 0.10.2
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 +5 -0
- package/dist/ostack-ui.js +32 -11
- package/dist/ostack-ui.js.map +1 -1
- package/dist/types/components/Feedback/Feedback.d.ts +2 -3
- package/dist/types/components/Field/Field.d.ts +2 -3
- package/dist/types/components/Field/FieldContext.d.ts +5 -1
- package/package.json +1 -1
- package/scss/components/Heading/_Heading-variables.scss +1 -1
- package/scss/components/Heading/_Heading.scss +8 -2
package/dist/ostack-ui.css
CHANGED
|
@@ -2455,7 +2455,12 @@ a > .o-ui-code {
|
|
|
2455
2455
|
|
|
2456
2456
|
.o-ui-heading {
|
|
2457
2457
|
margin-top: 0;
|
|
2458
|
+
margin-bottom: 0;
|
|
2459
|
+
}
|
|
2460
|
+
.o-ui-heading:not(:last-child) {
|
|
2458
2461
|
margin-bottom: calc(var(--o-ui-space) * 2);
|
|
2462
|
+
}
|
|
2463
|
+
.o-ui-heading {
|
|
2459
2464
|
font-weight: 700;
|
|
2460
2465
|
}
|
|
2461
2466
|
.o-ui-heading--1 {
|
package/dist/ostack-ui.js
CHANGED
|
@@ -826,6 +826,7 @@ function useCreateFieldContext() {
|
|
|
826
826
|
controlTagName: void 0,
|
|
827
827
|
controlFocused: false,
|
|
828
828
|
controlRequired: false,
|
|
829
|
+
controlStatus: void 0,
|
|
829
830
|
controlHasCode: false,
|
|
830
831
|
label: void 0,
|
|
831
832
|
labelId: void 0,
|
|
@@ -871,6 +872,9 @@ function useFieldControlFocused() {
|
|
|
871
872
|
function useFieldControlRequired() {
|
|
872
873
|
return useFieldStore((state) => state.controlRequired);
|
|
873
874
|
}
|
|
875
|
+
function useFieldControlStatus() {
|
|
876
|
+
return useFieldStore((state) => state.controlStatus);
|
|
877
|
+
}
|
|
874
878
|
function useFieldLabel() {
|
|
875
879
|
return useFieldStore((state) => state.label);
|
|
876
880
|
}
|
|
@@ -883,7 +887,7 @@ function useFieldDescriptionIds() {
|
|
|
883
887
|
function useFieldErrorMessageIds() {
|
|
884
888
|
return useFieldStore((state) => state.errorMessageIds);
|
|
885
889
|
}
|
|
886
|
-
function useSetFieldControl(controlId, controlTagName, controlCodeId, controlHasCode = false, controlRequired = false) {
|
|
890
|
+
function useSetFieldControl(controlId, controlTagName, controlCodeId, controlHasCode = false, controlRequired = false, controlStatus = void 0) {
|
|
887
891
|
const prefix = usePrefix();
|
|
888
892
|
const store = useFieldContext();
|
|
889
893
|
const generatedId = useId();
|
|
@@ -894,15 +898,24 @@ function useSetFieldControl(controlId, controlTagName, controlCodeId, controlHas
|
|
|
894
898
|
controlId: actualControlId,
|
|
895
899
|
controlTagName,
|
|
896
900
|
controlHasCode,
|
|
897
|
-
controlRequired
|
|
901
|
+
controlRequired,
|
|
902
|
+
controlStatus
|
|
898
903
|
});
|
|
899
904
|
return () => store?.setState?.({
|
|
900
905
|
controlId: void 0,
|
|
901
906
|
controlTagName: void 0,
|
|
902
907
|
controlHasCode: false,
|
|
903
|
-
controlRequired: false
|
|
908
|
+
controlRequired: false,
|
|
909
|
+
controlStatus: void 0
|
|
904
910
|
});
|
|
905
|
-
}, [
|
|
911
|
+
}, [
|
|
912
|
+
actualControlId,
|
|
913
|
+
controlTagName,
|
|
914
|
+
controlHasCode,
|
|
915
|
+
controlRequired,
|
|
916
|
+
store,
|
|
917
|
+
controlStatus
|
|
918
|
+
]);
|
|
906
919
|
return {
|
|
907
920
|
generatedId,
|
|
908
921
|
controlId: actualControlId,
|
|
@@ -3741,7 +3754,8 @@ const Table = forwardRef(
|
|
|
3741
3754
|
"DIV",
|
|
3742
3755
|
void 0,
|
|
3743
3756
|
false,
|
|
3744
|
-
required
|
|
3757
|
+
required,
|
|
3758
|
+
status
|
|
3745
3759
|
);
|
|
3746
3760
|
const visuallyHiddenCaptionId = visuallyHiddenCaption ? visuallyHiddenCaptionProps?.id ?? prefix(`table-caption-${generatedId}`) : void 0;
|
|
3747
3761
|
const tableRef = useRef(null);
|
|
@@ -4927,7 +4941,8 @@ const Checkbox = forwardRef(function Checkbox2({
|
|
|
4927
4941
|
"BUTTON",
|
|
4928
4942
|
codeProps?.id,
|
|
4929
4943
|
Boolean(code),
|
|
4930
|
-
required
|
|
4944
|
+
required,
|
|
4945
|
+
status
|
|
4931
4946
|
);
|
|
4932
4947
|
const labelId = children && (labelProps?.id ?? prefix(`checkbox-label-${generatedId}`));
|
|
4933
4948
|
const loadingDescriptionId = loading && loadingDescription && prefix(`control-loading-${generatedId}`);
|
|
@@ -6173,7 +6188,8 @@ const Input$1 = forwardRef(
|
|
|
6173
6188
|
tagName,
|
|
6174
6189
|
codeProps?.id,
|
|
6175
6190
|
Boolean(code),
|
|
6176
|
-
required
|
|
6191
|
+
required,
|
|
6192
|
+
status
|
|
6177
6193
|
);
|
|
6178
6194
|
const loadingDescriptionId = loading && loadingDescription && prefix(`control-loading-${generatedId}`);
|
|
6179
6195
|
const containerRef = useRef(null);
|
|
@@ -8975,7 +8991,8 @@ const CheckboxGroup = forwardRef(function CheckboxGroup2({
|
|
|
8975
8991
|
"DIV",
|
|
8976
8992
|
codeProps?.id,
|
|
8977
8993
|
Boolean(code),
|
|
8978
|
-
required
|
|
8994
|
+
required,
|
|
8995
|
+
status
|
|
8979
8996
|
);
|
|
8980
8997
|
const loadingDescriptionId = loading && loadingDescription ? prefix(`control-loading-${generatedId}`) : void 0;
|
|
8981
8998
|
const checkboxGroupRef = useRef(null);
|
|
@@ -9730,7 +9747,8 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
|
|
|
9730
9747
|
"INPUT",
|
|
9731
9748
|
codeProps?.id,
|
|
9732
9749
|
Boolean(code),
|
|
9733
|
-
required
|
|
9750
|
+
required,
|
|
9751
|
+
status
|
|
9734
9752
|
);
|
|
9735
9753
|
const setFieldControlFocused = useSetFieldControlFocused();
|
|
9736
9754
|
const startInputLabelId = startInputLabel && prefix(`control-start-label-${generatedId}`);
|
|
@@ -11046,7 +11064,7 @@ const FeedbackPopover = forwardRef(function FeedbackPopover2({
|
|
|
11046
11064
|
const Feedback = forwardRef(
|
|
11047
11065
|
function Feedback2({
|
|
11048
11066
|
asChild,
|
|
11049
|
-
type
|
|
11067
|
+
type,
|
|
11050
11068
|
visuallyHiddenPrefix,
|
|
11051
11069
|
id,
|
|
11052
11070
|
className,
|
|
@@ -11056,6 +11074,8 @@ const Feedback = forwardRef(
|
|
|
11056
11074
|
const prefix = usePrefix();
|
|
11057
11075
|
const [locale7] = useLocale();
|
|
11058
11076
|
visuallyHiddenPrefix ??= locale7.Feedback.visuallyHiddenPrefix;
|
|
11077
|
+
const controlStatus = useFieldControlStatus();
|
|
11078
|
+
type ??= controlStatus === "warned" ? "warning" : controlStatus === "valid" ? "success" : "error";
|
|
11059
11079
|
const { onAddFeedback, onRemoveFeedback } = useFeedbackPopoverContext() ?? {};
|
|
11060
11080
|
useLayoutEffect$1(() => {
|
|
11061
11081
|
onAddFeedback?.(type);
|
|
@@ -11938,7 +11958,8 @@ const RadioGroup = forwardRef(function RadioGroup2({
|
|
|
11938
11958
|
"DIV",
|
|
11939
11959
|
codeProps?.id,
|
|
11940
11960
|
Boolean(code),
|
|
11941
|
-
required
|
|
11961
|
+
required,
|
|
11962
|
+
status
|
|
11942
11963
|
);
|
|
11943
11964
|
const loadingDescriptionId = loading && loadingDescription && prefix(`control-loading-${generatedId}`);
|
|
11944
11965
|
const radioGroupRef = useRef(null);
|