@factorialco/rjsf-f0 2.3.1 → 2.5.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/index.d.ts +1 -1
- package/dist/rjsf-f0.cjs.js +30 -30
- package/dist/rjsf-f0.cjs.js.map +1 -1
- package/dist/rjsf-f0.es.js +8309 -9794
- package/dist/rjsf-f0.es.js.map +1 -1
- package/dist/src/multistep/index.d.ts +4 -3
- package/dist/src/multistep/leave-confirm.d.ts +7 -0
- package/dist/src/multistep/types.d.ts +12 -1
- package/dist/src/oauth/index.d.ts +1 -1
- package/dist/src/utils/markdown-content.d.ts +2 -2
- package/dist/styles.css +146 -14
- package/package.json +6 -6
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const Multistep: {
|
|
2
|
-
StepsNavigation: ({ layout, items, currentIndex, onNavigate, children, }: import('./types').StepsNavigationProps) => import(
|
|
3
|
-
BackButton: ({ label, onClick, disabled, }: import('./types').StepBackButtonProps) => import(
|
|
2
|
+
StepsNavigation: ({ layout, items, currentIndex, onNavigate, children, }: import('./types').StepsNavigationProps) => import('../../node_modules/@types/react').JSX.Element;
|
|
3
|
+
BackButton: ({ label, onClick, disabled, }: import('./types').StepBackButtonProps) => import('../../node_modules/@types/react').JSX.Element;
|
|
4
|
+
LeaveConfirm: ({ open, title, message, confirmLabel, cancelLabel, onConfirm, onCancel, }: import('./types').LeaveConfirmProps) => import('../../node_modules/@types/react').JSX.Element;
|
|
4
5
|
};
|
|
5
|
-
export type { StepBackButtonProps, StepsLayout, StepsNavigationItem, StepsNavigationProps, StepStatus, } from './types';
|
|
6
|
+
export type { LeaveConfirmProps, StepBackButtonProps, StepsLayout, StepsNavigationItem, StepsNavigationProps, StepStatus, } from './types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from '../../node_modules/@types/react';
|
|
2
|
+
import { LeaveConfirmProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Asked before leaving a flow's step for an earlier one with values typed but
|
|
5
|
+
* not submitted. Closing the dialog any other way keeps the user on the step.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LeaveConfirm: ({ open, title, message, confirmLabel, cancelLabel, onConfirm, onCancel, }: LeaveConfirmProps) => React.JSX.Element;
|
|
@@ -6,7 +6,7 @@ import { default as React } from '../../node_modules/@types/react';
|
|
|
6
6
|
* TypeScript's structural typing keeps them interchangeable.
|
|
7
7
|
*/
|
|
8
8
|
export type StepsLayout = 'tabs' | 'sidebar';
|
|
9
|
-
export type StepStatus = 'completed' | 'current' | 'upcoming';
|
|
9
|
+
export type StepStatus = 'completed' | 'current' | 'upcoming' | 'skipped';
|
|
10
10
|
export interface StepsNavigationItem {
|
|
11
11
|
index: number;
|
|
12
12
|
title: string;
|
|
@@ -14,6 +14,8 @@ export interface StepsNavigationItem {
|
|
|
14
14
|
status: StepStatus;
|
|
15
15
|
clickable: boolean;
|
|
16
16
|
hasErrors: boolean;
|
|
17
|
+
depth?: number;
|
|
18
|
+
counter?: string;
|
|
17
19
|
}
|
|
18
20
|
export interface StepsNavigationProps {
|
|
19
21
|
layout: StepsLayout;
|
|
@@ -22,6 +24,15 @@ export interface StepsNavigationProps {
|
|
|
22
24
|
onNavigate: (index: number) => void;
|
|
23
25
|
children: React.ReactNode;
|
|
24
26
|
}
|
|
27
|
+
export interface LeaveConfirmProps {
|
|
28
|
+
open: boolean;
|
|
29
|
+
title: string;
|
|
30
|
+
message: string;
|
|
31
|
+
confirmLabel: string;
|
|
32
|
+
cancelLabel: string;
|
|
33
|
+
onConfirm: () => void;
|
|
34
|
+
onCancel: () => void;
|
|
35
|
+
}
|
|
25
36
|
export interface StepBackButtonProps {
|
|
26
37
|
label: string;
|
|
27
38
|
onClick: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const Oauth: {
|
|
2
|
-
ConnectControl: ({ id, status, label, disabled, errorMessage, onClick, }: import('./types').OauthConnectControlProps) => import(
|
|
2
|
+
ConnectControl: ({ id, status, label, disabled, errorMessage, onClick, }: import('./types').OauthConnectControlProps) => import('../../node_modules/@types/react').JSX.Element;
|
|
3
3
|
};
|
|
4
4
|
export type { OauthConnectControlProps, OauthConnectStatus } from './types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Options as ReactMarkdownProps } from 'react-markdown';
|
|
2
|
-
export declare function MarkdownContent(props: ReactMarkdownProps): import(
|
|
2
|
+
export declare function MarkdownContent(props: ReactMarkdownProps): import('../../node_modules/@types/react').JSX.Element;
|
|
3
3
|
/**
|
|
4
4
|
* Block-level markdown (GFM) for standalone content: execution result
|
|
5
5
|
* messages and `schema.markdown.before/after`. `MarkdownContent` above stays
|
|
6
6
|
* intentionally narrow for inline field text.
|
|
7
7
|
*/
|
|
8
|
-
export declare function MarkdownBlock(props: ReactMarkdownProps): import(
|
|
8
|
+
export declare function MarkdownBlock(props: ReactMarkdownProps): import('../../node_modules/@types/react').JSX.Element;
|
package/dist/styles.css
CHANGED
|
@@ -504,8 +504,8 @@
|
|
|
504
504
|
* Like the `json` field below, it is rendered by the SDK (`LoadingOverlay`),
|
|
505
505
|
* not by this theme, and its positioning lives in the SDK's standalone
|
|
506
506
|
* stylesheet — which f0 consumers deliberately do not load. Without these
|
|
507
|
-
* rules the overlay falls into the normal flow: the form grows to fit
|
|
508
|
-
*
|
|
507
|
+
* rules the overlay falls into the normal flow: the form grows to fit the
|
|
508
|
+
* spinner (and any message) at the bottom and shrinks back after the submit.
|
|
509
509
|
* The mechanism is the SDK's (root anchors, overlay covers it); the scrim and
|
|
510
510
|
* text use f0's neutral scale so both flip in dark mode, and the spinner uses
|
|
511
511
|
* f0's selected hue, its usual loading colour.
|
|
@@ -856,35 +856,159 @@
|
|
|
856
856
|
}
|
|
857
857
|
|
|
858
858
|
/*
|
|
859
|
-
* Multistep (`ui:steps`) navigation
|
|
860
|
-
*
|
|
859
|
+
* Multistep (`ui:steps`) navigation, laid out like f0's own `F0WizardForm`:
|
|
860
|
+
* a step list beside the form behind a dashed divider, numbered badges that
|
|
861
|
+
* turn into a check once a step is done, the current step tinted, and the
|
|
862
|
+
* actions as a footer row. Colours are f0's own tokens.
|
|
861
863
|
*/
|
|
862
864
|
|
|
863
865
|
.rjsf-f0-steps-tabs {
|
|
864
|
-
display: flex;
|
|
865
|
-
flex-wrap: wrap;
|
|
866
|
-
gap: 0.25rem;
|
|
867
866
|
margin-bottom: 1.5rem;
|
|
868
867
|
padding-bottom: 0.5rem;
|
|
869
|
-
border-bottom: 1px
|
|
868
|
+
border-bottom: 1px dashed hsl(var(--neutral-20, 214 70% 20% / 0.1));
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/* In the tabs layout the same step list runs in a row above the form. */
|
|
872
|
+
.rjsf-f0-steps-tabs .rjsf-f0-steps-list {
|
|
873
|
+
position: static;
|
|
874
|
+
flex-direction: row;
|
|
875
|
+
flex-wrap: wrap;
|
|
876
|
+
gap: 0.25rem;
|
|
877
|
+
padding: 0;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
.rjsf-f0-steps-tabs .rjsf-f0-steps-item {
|
|
881
|
+
width: auto;
|
|
882
|
+
padding: 0.375rem 0.5rem;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
.rjsf-f0-steps-tabs .rjsf-f0-steps-item-title {
|
|
886
|
+
flex: none;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/* A row has no room to indent sub-steps; their "2.1" badges set them apart. */
|
|
890
|
+
.rjsf-f0-steps-tabs .rjsf-f0-steps-item-substep {
|
|
891
|
+
margin-left: 0;
|
|
870
892
|
}
|
|
871
893
|
|
|
872
894
|
/* Wraps to a stacked layout on narrow widths via the main column's min-width. */
|
|
873
895
|
.rjsf-f0-steps-layout-sidebar {
|
|
874
896
|
display: flex;
|
|
875
897
|
flex-wrap: wrap;
|
|
876
|
-
|
|
877
|
-
|
|
898
|
+
align-items: stretch;
|
|
899
|
+
row-gap: 1rem;
|
|
878
900
|
}
|
|
879
901
|
|
|
880
|
-
.rjsf-f0-steps-nav {
|
|
881
|
-
flex:
|
|
882
|
-
|
|
902
|
+
.rjsf-f0-steps-layout-sidebar .rjsf-f0-steps-nav {
|
|
903
|
+
flex: 0 0 clamp(12rem, 30%, 18rem);
|
|
904
|
+
box-sizing: border-box;
|
|
905
|
+
padding: 0.5rem 0.5rem 0.5rem 0;
|
|
906
|
+
border-right: 1px dashed hsl(var(--neutral-20, 214 70% 20% / 0.1));
|
|
883
907
|
}
|
|
884
908
|
|
|
885
909
|
.rjsf-f0-steps-layout-sidebar .rjsf-f0-steps-main {
|
|
886
910
|
flex: 1 1 24rem;
|
|
887
911
|
min-width: 0;
|
|
912
|
+
padding-left: 2rem;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
.rjsf-f0-steps-list {
|
|
916
|
+
/* The list stays in view while a long step scrolls past it. */
|
|
917
|
+
position: sticky;
|
|
918
|
+
top: 1rem;
|
|
919
|
+
display: flex;
|
|
920
|
+
flex-direction: column;
|
|
921
|
+
gap: 0.375rem;
|
|
922
|
+
margin: 0;
|
|
923
|
+
padding: 0.25rem;
|
|
924
|
+
list-style: none;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
.rjsf-f0-steps-item {
|
|
928
|
+
display: flex;
|
|
929
|
+
align-items: center;
|
|
930
|
+
gap: 0.5rem;
|
|
931
|
+
box-sizing: border-box;
|
|
932
|
+
width: 100%;
|
|
933
|
+
padding: 0.5rem;
|
|
934
|
+
border: 0;
|
|
935
|
+
border-radius: 0.625rem;
|
|
936
|
+
background: transparent;
|
|
937
|
+
color: hsl(var(--neutral-100, 218 48% 10%));
|
|
938
|
+
font: inherit;
|
|
939
|
+
text-align: left;
|
|
940
|
+
cursor: default;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
.rjsf-f0-steps-item-reachable {
|
|
944
|
+
cursor: pointer;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
.rjsf-f0-steps-item-reachable:hover {
|
|
948
|
+
background-color: hsl(var(--neutral-20, 214 70% 20% / 0.1));
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.rjsf-f0-steps-item:focus-visible {
|
|
952
|
+
outline: 2px solid hsl(var(--selected-50, 184 92% 35%));
|
|
953
|
+
outline-offset: 1px;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
/* A process step heading its form's sub-steps: the sub-step is tinted, not it. */
|
|
957
|
+
.rjsf-f0-steps-item-current:not(.rjsf-f0-steps-item-group) {
|
|
958
|
+
background-color: hsl(var(--selected-50, 184 92% 35%) / 0.1);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.rjsf-f0-steps-item:disabled:not(.rjsf-f0-steps-item-current) {
|
|
962
|
+
opacity: 0.7;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
.rjsf-f0-steps-item-substep {
|
|
966
|
+
margin-left: 1.75rem;
|
|
967
|
+
width: calc(100% - 1.75rem);
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
.rjsf-f0-steps-item-title {
|
|
971
|
+
flex: 1;
|
|
972
|
+
font-size: 0.875rem;
|
|
973
|
+
font-weight: 500;
|
|
974
|
+
line-height: 1.25rem;
|
|
975
|
+
letter-spacing: -0.005em;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
.rjsf-f0-steps-item-completed .rjsf-f0-steps-item-title,
|
|
979
|
+
.rjsf-f0-steps-item-skipped .rjsf-f0-steps-item-title {
|
|
980
|
+
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
.rjsf-f0-steps-item-skipped .rjsf-f0-steps-item-title {
|
|
984
|
+
text-decoration: line-through;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
.rjsf-f0-steps-badge {
|
|
988
|
+
display: inline-flex;
|
|
989
|
+
flex-shrink: 0;
|
|
990
|
+
align-items: center;
|
|
991
|
+
justify-content: center;
|
|
992
|
+
box-sizing: border-box;
|
|
993
|
+
min-width: 1.25rem;
|
|
994
|
+
height: 1.25rem;
|
|
995
|
+
padding: 0 0.25rem;
|
|
996
|
+
border-radius: 0.375rem;
|
|
997
|
+
background-color: hsl(var(--neutral-10, 210 91% 22% / 0.03));
|
|
998
|
+
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
999
|
+
font-size: 0.75rem;
|
|
1000
|
+
font-weight: 500;
|
|
1001
|
+
line-height: 1;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.rjsf-f0-steps-badge-current {
|
|
1005
|
+
background-color: hsl(var(--selected-60, 184 92% 30%));
|
|
1006
|
+
color: #fff;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
.rjsf-f0-steps-item-errors .rjsf-f0-steps-badge {
|
|
1010
|
+
background-color: hsl(var(--critical-50, 4 84% 60%) / 0.1);
|
|
1011
|
+
color: hsl(var(--critical-70, 4 84% 45%));
|
|
888
1012
|
}
|
|
889
1013
|
|
|
890
1014
|
.rjsf-f0-steps-header {
|
|
@@ -903,15 +1027,23 @@
|
|
|
903
1027
|
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
904
1028
|
}
|
|
905
1029
|
|
|
1030
|
+
.rjsf-f0-steps-leave-message {
|
|
1031
|
+
margin: 0;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
906
1034
|
/*
|
|
907
1035
|
* The actions row (rendered by the SDK's step engine) holds Back and
|
|
908
|
-
* Next/Submit
|
|
1036
|
+
* Next/Submit as a footer, right-aligned like f0's wizard; it takes over the
|
|
1037
|
+
* submit button's usual top margin.
|
|
909
1038
|
*/
|
|
910
1039
|
.fcode-steps-actions {
|
|
911
1040
|
display: flex;
|
|
912
1041
|
align-items: center;
|
|
1042
|
+
justify-content: flex-end;
|
|
913
1043
|
gap: 0.75rem;
|
|
914
1044
|
margin-top: 1.5rem;
|
|
1045
|
+
padding-top: 1rem;
|
|
1046
|
+
border-top: 1px solid hsl(var(--neutral-20, 214 70% 20% / 0.1));
|
|
915
1047
|
}
|
|
916
1048
|
|
|
917
1049
|
.fcode-steps-actions .rjsf-f0-submit {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@factorialco/rjsf-f0",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Factorial f0 theme for react-jsonschema-form: renders RJSF forms with f0 components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://code.factorialhr.com/docs/forms/",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dev": "vite"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@factorialco/f0-react": "^4.39.0 || ^6",
|
|
43
|
+
"@factorialco/f0-react": "^4.39.0 || ^6 || ^7 || ^8 || ^9 || ^10 || ^11",
|
|
44
44
|
"@rjsf/core": "^6.7.1",
|
|
45
45
|
"@rjsf/utils": "^6.7.1",
|
|
46
46
|
"react": "^18.3.1 || ^19.0.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"remark-gfm": "^4.0.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@factorialco/f0-react": "6.
|
|
54
|
+
"@factorialco/f0-react": "11.6.3",
|
|
55
55
|
"@rjsf/core": "^6.7.1",
|
|
56
56
|
"@rjsf/utils": "^6.7.1",
|
|
57
57
|
"@rjsf/validator-ajv8": "^6.7.1",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"@types/node": "^22.0.0",
|
|
61
61
|
"@types/react": "^18.3.12",
|
|
62
62
|
"@types/react-dom": "^18.3.1",
|
|
63
|
-
"@vitejs/plugin-react": "^
|
|
63
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
64
64
|
"jsdom": "^28.0.0",
|
|
65
65
|
"react": "18.3.1",
|
|
66
66
|
"react-dom": "18.3.1",
|
|
67
67
|
"typescript": "^5.4.5",
|
|
68
|
-
"vite": "^
|
|
69
|
-
"vite-plugin-dts": "^
|
|
68
|
+
"vite": "^8.3.5",
|
|
69
|
+
"vite-plugin-dts": "^5.1.2",
|
|
70
70
|
"vitest": "^4.0.0"
|
|
71
71
|
}
|
|
72
72
|
}
|