@indico-data/design-system 2.0.3 → 2.1.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.
Files changed (36) hide show
  1. package/.commitlintrc.ts +13 -0
  2. package/.harness/pipeline.yaml +1 -1
  3. package/.releaserc.json +16 -1
  4. package/README.md +57 -27
  5. package/lib/index.css +84 -67
  6. package/lib/index.d.ts +49 -156
  7. package/lib/index.esm.css +84 -67
  8. package/lib/index.esm.js +1 -287
  9. package/lib/index.esm.js.map +1 -1
  10. package/lib/index.js +0 -291
  11. package/lib/index.js.map +1 -1
  12. package/lib/legacy/components/index.d.ts +0 -2
  13. package/package.json +4 -3
  14. package/src/components/button/{Button.scss → styles/Button.scss} +5 -69
  15. package/src/components/button/styles/_variables.scss +89 -0
  16. package/src/index.ts +0 -5
  17. package/src/legacy/components/index.ts +0 -2
  18. package/src/styles/index.scss +1 -1
  19. package/src/styles/variables/themes/dark.scss +70 -74
  20. package/src/stylesAndAnimations/colors/constants.ts +60 -60
  21. package/lib/legacy/components/Wizard/Wizard.d.ts +0 -48
  22. package/lib/legacy/components/Wizard/Wizard.stories.d.ts +0 -29
  23. package/lib/legacy/components/Wizard/Wizard.styles.d.ts +0 -4
  24. package/lib/legacy/components/Wizard/index.d.ts +0 -2
  25. package/lib/legacy/components/WizardWithSidebar/WizardWithSidebar.d.ts +0 -58
  26. package/lib/legacy/components/WizardWithSidebar/WizardWithSidebar.stories.d.ts +0 -46
  27. package/lib/legacy/components/WizardWithSidebar/WizardWithSidebar.styles.d.ts +0 -9
  28. package/lib/legacy/components/WizardWithSidebar/index.d.ts +0 -2
  29. package/src/legacy/components/Wizard/Wizard.stories.tsx +0 -180
  30. package/src/legacy/components/Wizard/Wizard.styles.ts +0 -72
  31. package/src/legacy/components/Wizard/Wizard.tsx +0 -211
  32. package/src/legacy/components/Wizard/index.ts +0 -2
  33. package/src/legacy/components/WizardWithSidebar/WizardWithSidebar.stories.tsx +0 -143
  34. package/src/legacy/components/WizardWithSidebar/WizardWithSidebar.styles.ts +0 -107
  35. package/src/legacy/components/WizardWithSidebar/WizardWithSidebar.tsx +0 -278
  36. package/src/legacy/components/WizardWithSidebar/index.ts +0 -2
package/lib/index.js CHANGED
@@ -24127,292 +24127,6 @@ function LoadingAwareContainer(props) {
24127
24127
  return (jsxRuntime.jsxs(StyledLoadingAwareContainer, { className: y({ loading: isLoading }, className), style: style, children: [jsxRuntime.jsx(StyledStatusContainer, { role: "status", children: isLoading && 'Loading' }), isLoading ? jsxRuntime.jsx(LoadingIndicator, {}) : jsxRuntime.jsx(jsxRuntime.Fragment, { children: children })] }));
24128
24128
  }
24129
24129
 
24130
- const StyledWizard = styled__default.default.div `
24131
- nav {
24132
- display: flex;
24133
- align-items: center;
24134
- justify-content: space-between;
24135
-
24136
- margin-bottom: 24px;
24137
-
24138
- // override for some styling in AppChrome IPA component
24139
- padding-left: 0 !important;
24140
- padding-right: 0 !important;
24141
- }
24142
-
24143
- h1 {
24144
- margin-bottom: 0;
24145
- }
24146
-
24147
- .wizard-buttons {
24148
- display: flex;
24149
- align-items: center;
24150
-
24151
- font-size: ${typography.fontSize.subheadLarge};
24152
-
24153
- button.link-style {
24154
- font-size: inherit;
24155
- margin-right: 1em;
24156
- }
24157
- }
24158
- `;
24159
- const commonPadding = '20px';
24160
- // todo: permafrost: move into css fragment at top level
24161
- const WizardCard = styled__default.default.div `
24162
- width: 100%;
24163
- padding: 14px ${commonPadding};
24164
-
24165
- background-color: ${allColors.clay};
24166
- border: 1px solid ${allColors.oxfordBlue};
24167
- border-radius: 4px;
24168
- box-shadow: 1px 1px 1px 0 ${allColors.ebony};
24169
- `;
24170
- const WizardSection = styled__default.default.div `
24171
- .section-heading {
24172
- margin-bottom: 0;
24173
- // todo: store value elsewhere
24174
- font-size: 22px;
24175
- color: ${allColors.lightFontColor};
24176
-
24177
- .supporting-text {
24178
- font-size: ${typography.fontSize.subheadLarge};
24179
- color: ${allColors.defaultFontColor};
24180
- }
24181
- }
24182
-
24183
- .section-content {
24184
- padding: ${commonPadding};
24185
- }
24186
-
24187
- :not(:last-of-type) {
24188
- margin-bottom: ${commonPadding};
24189
-
24190
- .section-content {
24191
- border-bottom: 1px solid ${allColors.ebony};
24192
- }
24193
- }
24194
- `;
24195
-
24196
- const commonButtonProps = {
24197
- size: 'large',
24198
- };
24199
- function Wizard(props) {
24200
- const { children, className, confirmCancel, disableNextStep, disablePrevStep, disableSubmit, id, isLastStep, onCancel, onNextPress, onStepChange, onSubmit, startingStep, steps, submitButtonLabel, submitProcessing = '', wizardTitle, nextButtonProps, } = props;
24201
- const [currentStep, setCurrentStep] = React$1.useState(startingStep || steps[0]);
24202
- const [openCancelConfirm, setOpenCancelConfirm] = React$1.useState(false);
24203
- const onLastStep = React$1.useMemo(() => {
24204
- if (isLastStep !== undefined) {
24205
- return isLastStep;
24206
- }
24207
- return steps.indexOf(currentStep) === steps.length - 1;
24208
- }, [isLastStep, steps, currentStep]);
24209
- const isBusy = !!(submitProcessing && submitProcessing.length > 0);
24210
- const nextStep = () => {
24211
- if (!onLastStep) {
24212
- const currentIndex = steps.indexOf(currentStep);
24213
- setCurrentStep(steps[currentIndex + 1]);
24214
- }
24215
- };
24216
- const prevStep = () => {
24217
- const currentIndex = steps.indexOf(currentStep);
24218
- if (currentIndex !== 0) {
24219
- setCurrentStep(steps[currentIndex - 1]);
24220
- }
24221
- };
24222
- // handles the user's selection in the cancel confirmation modal
24223
- const handleCancelRequest = (confirmCancel) => {
24224
- if (confirmCancel && onCancel) {
24225
- onCancel();
24226
- }
24227
- setOpenCancelConfirm(false);
24228
- };
24229
- const handleNextPress = () => {
24230
- const allowNext = onNextPress ? onNextPress() : true;
24231
- if (!allowNext) {
24232
- return;
24233
- }
24234
- if (onLastStep) {
24235
- handleSubmit();
24236
- }
24237
- else {
24238
- nextStep();
24239
- }
24240
- };
24241
- const handleSubmit = () => {
24242
- onSubmit();
24243
- };
24244
- // report current step to the consuming component
24245
- React$1.useEffect(() => {
24246
- onStepChange(currentStep);
24247
- }, [currentStep]);
24248
- // ensures `currentStep` is reset on unmount, just in case
24249
- React$1.useEffect(() => {
24250
- return () => setCurrentStep(steps[0] || '');
24251
- }, []);
24252
- return (jsxRuntime.jsxs(StyledWizard, { className: className, "data-cy": props['data-cy'], id: id, children: [jsxRuntime.jsxs("nav", { children: [jsxRuntime.jsxs("h1", { children: [wizardTitle, ": ", currentStep] }), jsxRuntime.jsxs("div", { className: "wizard-buttons", children: [jsxRuntime.jsx(Button$2, { onClick: () => setOpenCancelConfirm(true), variant: "link-style", children: "Cancel" }), steps.indexOf(currentStep) !== 0 && (jsxRuntime.jsx(IconButton, Object.assign({}, commonButtonProps, { iconName: "fa-arrow-left", label: "Previous Step", onPress: prevStep, isDisabled: disablePrevStep }))), onLastStep ? (jsxRuntime.jsx(IconButton, Object.assign({}, commonButtonProps, { variant: "primary", iconName: "check", busy: isBusy, label: isBusy ? submitProcessing : submitButtonLabel, onPress: handleNextPress, isDisabled: disableSubmit }))) : (jsxRuntime.jsx(IconButton, Object.assign({}, commonButtonProps, { variant: "primary", iconSide: "end", iconName: "fa-arrow-right", label: "Next Step", onPress: handleNextPress, isDisabled: disableNextStep }, nextButtonProps)))] })] }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: children }), jsxRuntime.jsx(ConfirmModal, { title: confirmCancel.title, message: confirmCancel.message, confirmText: confirmCancel.confirmText, rejectText: confirmCancel.rejectText, open: openCancelConfirm, clickOutsideHandler: () => setOpenCancelConfirm(false), responseHandler: handleCancelRequest })] }));
24253
- }
24254
-
24255
- const StyledWizardWithSidebar = styled__default.default.div `
24256
- height: 750px;
24257
- display: flex;
24258
- /* display: flex;
24259
- /* min-height: 455px; */
24260
- background-color: ${(props) => (props.backgroundcolor ? props.backgroundcolor : 'currentColor')};
24261
- color: ${(props) => (props.color ? props.color : 'inherit')};
24262
- border-radius: 4px;
24263
- h2 {
24264
- font-size: ${typography.fontSize.subheadLarge};
24265
- margin-bottom: ${spacings.md};
24266
- color: ${(props) => (props.color ? props.color : 'inherit')};
24267
- font-weight: bold;
24268
- }
24269
-
24270
- .wizard-sidebar {
24271
- width: 245px;
24272
- padding: 30px;
24273
- border-right: 1px solid ${allColors.silverChalice};
24274
-
24275
- .sidebar-step {
24276
- margin-bottom: ${spacings.sm};
24277
- display: flex;
24278
- align-items: center;
24279
- color: ${allColors.silverChalice};
24280
- &.current-step,
24281
- &.prior-step {
24282
- color: ${allColors.black};
24283
- }
24284
-
24285
- &:last-child {
24286
- margin-bottom: 0;
24287
- }
24288
-
24289
- .sidebar-step__check-icon {
24290
- fill: ${allColors.green};
24291
- margin-right: ${spacings.sm};
24292
- width: 24px;
24293
- height: 24px;
24294
- }
24295
-
24296
- .sidebar-step__number-icon {
24297
- margin-right: ${spacings.sm};
24298
- width: 24px;
24299
- height: 24px;
24300
- border-radius: 50%;
24301
- border: 1px solid currentColor;
24302
- display: flex;
24303
- align-items: center;
24304
- justify-content: center;
24305
- font-size: ${typography.fontSize.caption};
24306
- }
24307
- }
24308
- }
24309
-
24310
- .wizard-content__wrapper {
24311
- display: flex;
24312
- justify-content: space-between;
24313
- flex-wrap: wrap;
24314
- flex-direction: column;
24315
- height: 100%;
24316
- }
24317
- .wizard-content {
24318
- width: 100%;
24319
- padding: 30px;
24320
-
24321
- .wizard-content__header {
24322
- flex: 0 0 100%;
24323
- }
24324
- .wizard-content__body {
24325
- flex: 0 0 100%;
24326
- }
24327
- }
24328
-
24329
- .wizard-actions {
24330
- width: 100%;
24331
- display: flex;
24332
- align-items: center;
24333
- justify-content: end;
24334
- }
24335
-
24336
- nav {
24337
- display: flex;
24338
- align-items: center;
24339
- justify-content: end;
24340
- // override for some styling in AppChrome IPA component
24341
- padding-left: 0 !important;
24342
- padding-right: 0 !important;
24343
- margin-top: ${spacings.md};
24344
- }
24345
- .wizard-buttons {
24346
- display: flex;
24347
- align-items: center;
24348
- font-size: ${typography.fontSize.subheadSmall};
24349
- }
24350
- `;
24351
-
24352
- function WizardWithSidebar(props) {
24353
- const { children, className, confirmCancel, disableNextStep, disablePrevStep, disableSubmit, id, isLastStep, onCancel, onNextPress, onStepChange, onSubmit, startingStep, stepSchema, submitButtonLabel, submitProcessing = '', wizardTitle, nextButtonProps, validationErrors, backgroundColor, color, buttonColor, } = props;
24354
- const steps = Object.keys(stepSchema);
24355
- const [currentStep, setCurrentStep] = React$1.useState(startingStep || steps[0]);
24356
- const [openCancelConfirm, setOpenCancelConfirm] = React$1.useState(false);
24357
- const onLastStep = React$1.useMemo(() => {
24358
- if (isLastStep !== undefined) {
24359
- return isLastStep;
24360
- }
24361
- return steps.indexOf(currentStep) === steps.length - 1;
24362
- }, [isLastStep, steps, currentStep]);
24363
- const isBusy = !!(submitProcessing && submitProcessing.length > 0);
24364
- const nextStep = () => {
24365
- if (!onLastStep) {
24366
- const currentIndex = steps.indexOf(currentStep);
24367
- setCurrentStep(steps[currentIndex + 1]);
24368
- }
24369
- };
24370
- const prevStep = () => {
24371
- const currentIndex = steps.indexOf(currentStep);
24372
- if (currentIndex !== 0) {
24373
- setCurrentStep(steps[currentIndex - 1]);
24374
- }
24375
- };
24376
- // handles the user's selection in the cancel confirmation modal
24377
- const handleCancelRequest = (confirmCancel) => {
24378
- if (confirmCancel && onCancel) {
24379
- onCancel();
24380
- }
24381
- setOpenCancelConfirm(false);
24382
- };
24383
- const handleNextPress = () => {
24384
- const allowNext = onNextPress ? onNextPress() : true;
24385
- if (!allowNext) {
24386
- return;
24387
- }
24388
- if (onLastStep) {
24389
- handleSubmit();
24390
- }
24391
- else {
24392
- nextStep();
24393
- }
24394
- };
24395
- const handleSubmit = () => {
24396
- onSubmit();
24397
- };
24398
- // report current step to the consuming component
24399
- React$1.useEffect(() => {
24400
- onStepChange(currentStep);
24401
- }, [currentStep]);
24402
- // ensures `currentStep` is reset on unmount, just in case
24403
- React$1.useEffect(() => {
24404
- return () => setCurrentStep(steps[0] || '');
24405
- }, []);
24406
- return (jsxRuntime.jsxs(StyledWizardWithSidebar, { className: className, "data-cy": props['data-cy'], id: id, backgroundcolor: backgroundColor, color: color, buttoncolor: buttonColor, children: [jsxRuntime.jsxs("div", { className: "wizard-sidebar", children: [jsxRuntime.jsxs("h2", { children: [" ", wizardTitle] }), steps.map((step, index) => {
24407
- return (jsxRuntime.jsxs("div", { className: y('sidebar-step', {
24408
- ['current-step']: index === steps.indexOf(currentStep),
24409
- ['prior-step']: index < steps.indexOf(currentStep),
24410
- }), children: [(Object.keys(validationErrors ? validationErrors : []).some((error) => stepSchema[step].inputsRequiringValidation.includes(error)) ||
24411
- index > steps.indexOf(currentStep)) && (jsxRuntime.jsx("div", { className: "sidebar-step__number-icon", children: index + 1 })), !Object.keys(validationErrors ? validationErrors : []).some((error) => stepSchema[step].inputsRequiringValidation.includes(error)) &&
24412
- index <= steps.indexOf(currentStep) && (jsxRuntime.jsx(Icon, { name: "fa-check-circle", className: "sidebar-step__check-icon" })), step] }, step));
24413
- })] }), jsxRuntime.jsx("div", { className: "wizard-content", children: jsxRuntime.jsxs("div", { className: "wizard-content__wrapper", children: [jsxRuntime.jsxs("div", { className: "wizard-content__items", children: [jsxRuntime.jsx("div", { className: "wizard-content__header", children: jsxRuntime.jsx("h2", { children: currentStep }) }), jsxRuntime.jsx("div", { className: "wizard-content__body", children: children })] }), jsxRuntime.jsx("nav", { className: "wizard-actions", children: jsxRuntime.jsxs("div", { className: "wizard-buttons", children: [jsxRuntime.jsx(Button, { ariaLabel: "cancel", variant: "text", color: "secondary", onClick: () => setOpenCancelConfirm(true), children: "Cancel" }), steps.indexOf(currentStep) !== 0 && (jsxRuntime.jsx(Button, { variant: "outline", color: "secondary", iconName: "fa-arrow-left", ariaLabel: "previous step", onClick: prevStep, isDisabled: disablePrevStep, className: "mr-1", children: "Previous Step" })), onLastStep ? (jsxRuntime.jsx(Button, { ariaLabel: "submit", iconName: "check", color: "secondary", isLoading: isBusy, onClick: handleNextPress, isDisabled: disableSubmit, children: isBusy ? submitProcessing : submitButtonLabel })) : (jsxRuntime.jsx(Button, Object.assign({ ariaLabel: "next step", iconPosition: "right", color: "secondary", iconName: "fa-arrow-right", onClick: handleNextPress, isDisabled: disableNextStep }, nextButtonProps, { children: "Next Step" })))] }) })] }) }), jsxRuntime.jsx(ConfirmModal, { title: confirmCancel.title, message: confirmCancel.message, confirmText: confirmCancel.confirmText, rejectText: confirmCancel.rejectText, open: openCancelConfirm, clickOutsideHandler: () => setOpenCancelConfirm(false), responseHandler: handleCancelRequest, width: 430 })] }));
24414
- }
24415
-
24416
24130
  const StyledDrawerLinkList = styled__default.default.div `
24417
24131
  .drawer__list {
24418
24132
  white-space: nowrap;
@@ -27307,16 +27021,11 @@ exports.SectionTable = SectionTable;
27307
27021
  exports.Select = Select;
27308
27022
  exports.Shrug = Shrug;
27309
27023
  exports.SingleCombobox = SingleCombobox;
27310
- exports.StyledWizard = StyledWizard;
27311
27024
  exports.TYPOGRAPHY = typography;
27312
27025
  exports.TextInput = TextInput;
27313
27026
  exports.TextTruncate = TextTruncate;
27314
27027
  exports.Toggle = Toggle;
27315
27028
  exports.Tooltip = Tooltip;
27316
- exports.Wizard = Wizard;
27317
- exports.WizardCard = WizardCard;
27318
- exports.WizardSection = WizardSection;
27319
- exports.WizardWithSidebar = WizardWithSidebar;
27320
27029
  exports.colorUtils = color;
27321
27030
  exports.faIcons = faIcons;
27322
27031
  exports.indicons = indicons;