@shipengine/elements 2.3.1 → 2.4.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.
Files changed (53) hide show
  1. package/actions-menu.js +3 -12
  2. package/components.js +1 -1
  3. package/elements.js +1 -1
  4. package/hooks.js +1 -1
  5. package/index.js +1 -1
  6. package/package.json +5 -3
  7. package/src/components/field/create-field-controller.d.ts +2 -1
  8. package/src/components/field-label/field-label.d.ts +2 -1
  9. package/src/components/field-label/field-label.styles.d.ts +16 -0
  10. package/src/components/grid-controller/grid-controller.d.ts +20 -2
  11. package/src/components/grid-controller/grid-controller.styles.d.ts +18 -6
  12. package/src/components/grid-controller/grid-footer.d.ts +27 -0
  13. package/src/components/grid-controller/index.d.ts +2 -0
  14. package/src/components/grid-filters/grid-filters.d.ts +30 -0
  15. package/src/components/grid-filters/grid-filters.styles.d.ts +11 -0
  16. package/src/components/grid-filters/index.d.ts +2 -0
  17. package/src/components/grid-filters/shipment-id-filter-shema.d.ts +9 -0
  18. package/src/components/grid-filters/shipment-id-filter.d.ts +23 -0
  19. package/src/components/index.d.ts +1 -0
  20. package/src/elements/label-layout/label-layout-element.d.ts +33 -7
  21. package/src/elements/labels-grid/hooks/use-labels-grid.d.ts +67 -0
  22. package/src/elements/labels-grid/index.d.ts +1 -0
  23. package/src/elements/labels-grid/labels-grid.d.ts +88 -19
  24. package/src/elements/labels-grid/labels-grid.styles.d.ts +5 -0
  25. package/src/elements/manage-carriers/manage-carriers.d.ts +33 -7
  26. package/src/elements/manage-external-carriers/manage-external-carriers.d.ts +33 -7
  27. package/src/elements/manage-funding/manage-funding-element.d.ts +33 -7
  28. package/src/elements/manage-warehouses/manage-warehouses.d.ts +33 -7
  29. package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +33 -7
  30. package/src/elements/purchase-label/purchase-label.d.ts +34 -45
  31. package/src/elements/shipment-summary/shipment-summary.d.ts +33 -7
  32. package/src/elements/shipments-grid/shipments-grid.d.ts +33 -7
  33. package/src/elements/theme-creator/theme-creator.d.ts +33 -7
  34. package/src/elements/transaction-history/transaction-history-element.d.ts +33 -7
  35. package/src/elements/unit-settings/unit-settings-element.d.ts +33 -7
  36. package/src/elements/vat-settings/vat-settings-element.d.ts +33 -7
  37. package/src/elements/void-label/void-label.d.ts +33 -7
  38. package/src/hooks/index.d.ts +1 -0
  39. package/src/hooks/use-get-service-name.d.ts +4 -0
  40. package/src/locales/en/index.d.ts +33 -7
  41. package/src/workflows/account-settings/account-settings.d.ts +33 -7
  42. package/src/workflows/carrier-services/carrier-services.d.ts +33 -7
  43. package/src/workflows/connect-external-carrier/connect-external-carrier.d.ts +33 -7
  44. package/src/workflows/onboarding/components/carrier-recovery-form/carrier-recovery-form-schema.d.ts +18 -18
  45. package/src/workflows/onboarding/onboarding.d.ts +33 -7
  46. package/suspend-text.js +1 -1
  47. package/transaction-history-element.js +1 -1
  48. package/use-get-service-name.js +1 -0
  49. package/use-unit-settings.js +1 -1
  50. package/usePager.js +1 -0
  51. package/vat.js +1 -1
  52. package/wallet-form.js +1 -1
  53. package/story-notes.js +0 -1
package/components.js CHANGED
@@ -1 +1 @@
1
- export{z as Actions,y as ActionsMenu,A as AddFundsForm,b as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,d as CarrierConnectionCard,e as CarrierIcon,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,l as EditBillingForm,m as ErrorFallback,F as FieldLabel,n as FormPortal,o as FundAndPurchase,H as HistoryCard,p as HistoryCardExtension,I as InlineLabel,q as ItemsBreakdown,L as LinkAction,r as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,t as SettingsCard,u as SkeletonCarrierRow,v as Spacer,w as Spread,T as Tabs,V as VatForm,W as WalletCard,x as WarehouseForm,c as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./actions-menu.js";export{C as CarrierLogo}from"./carrier-logo.js";export{C as CellFormattedDate,D as Drawer,G as GridController,P as Pager,S as SuspendText,u as usePager}from"./suspend-text.js";export{f as Field,S as StoryNotes}from"./story-notes.js";export{P as Portal}from"./use-toggle.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"humps";import"@shipengine/react-api";import"./address.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./vat.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"lodash/isEqual";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit";import"card-validator";import"./zod.js";import"react-dom";
1
+ export{z as Actions,y as ActionsMenu,A as AddFundsForm,b as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,d as CarrierConnectionCard,e as CarrierIcon,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,l as EditBillingForm,m as ErrorFallback,F as FieldLabel,n as FormPortal,o as FundAndPurchase,H as HistoryCard,p as HistoryCardExtension,I as InlineLabel,q as ItemsBreakdown,L as LinkAction,r as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,t as SettingsCard,u as SkeletonCarrierRow,v as Spacer,w as Spread,T as Tabs,V as VatForm,W as WalletCard,x as WarehouseForm,c as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./actions-menu.js";export{C as CarrierLogo}from"./carrier-logo.js";export{C as CellFormattedDate,D as Drawer,G as GridController,b as GridFilters,a as GridFooter,P as Pager,u as usePager}from"./usePager.js";export{f as Field,S as StoryNotes,a as SuspendText}from"./suspend-text.js";export{P as Portal}from"./use-toggle.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"humps";import"@shipengine/react-api";import"./address.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./vat.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"lodash/isEqual";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit";import"card-validator";import"./zod.js";import"react-use";import"react-dom";
package/elements.js CHANGED
@@ -1 +1 @@
1
- export{e as LabelLayout,l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,d as ManageFunding,a as ManageWarehouses,p as PaymentMethodSettings,s as ShipmentsGrid,t as ThemeCreator,T as ThemeCreatorProvider,f as TransactionHistory,c as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{a as CarrierServices,p as PurchaseLabel,s as ShipmentSummary,v as VoidLabel}from"./use-unit-settings.js";import"@emotion/react/jsx-runtime";import"./actions-menu.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"humps";import"@shipengine/react-api";import"./address.js";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./vat.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"./use-toggle.js";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"card-validator";import"./zod.js";import"./suspend-text.js";import"@tanstack/react-query";import"./use-scrub-errors.js";import"./shipment.js";import"lodash/orderBy";import"lodash/merge";import"lodash/mergeWith";import"./warehouses.js";import"axios";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";
1
+ export{e as LabelLayout,l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,d as ManageFunding,a as ManageWarehouses,p as PaymentMethodSettings,s as ShipmentsGrid,t as ThemeCreator,T as ThemeCreatorProvider,f as TransactionHistory,c as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{a as CarrierServices,p as PurchaseLabel,s as ShipmentSummary,v as VoidLabel}from"./use-unit-settings.js";import"@emotion/react/jsx-runtime";import"./actions-menu.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"humps";import"@shipengine/react-api";import"./address.js";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./vat.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"./use-toggle.js";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"card-validator";import"./zod.js";import"./use-get-service-name.js";import"./usePager.js";import"react-use";import"@tanstack/react-query";import"./use-scrub-errors.js";import"./shipment.js";import"lodash/orderBy";import"lodash/merge";import"lodash/mergeWith";import"./warehouses.js";import"axios";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";
package/hooks.js CHANGED
@@ -1 +1 @@
1
- export{R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle.js";export{P as PudoType,l as useBlackboxDetection,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,d as useInsuranceProviderOptions,m as useNestedForm,e as usePackageOptions,f as useRateOptions,n as useRunOnceOnTrue,o as useScrubErrors,g as useServiceCodeOptions,k as useServicePoints,h as useShipmentMetadata,i as useShippingPresetsOptions,j as useWarehouseOptions}from"./use-scrub-errors.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as useHelpers,b as usePageLayout}from"./use-page-layout.js";import"react";import"./address.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"humps";import"@shipengine/react-api";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"@emotion/react/jsx-runtime";import"react-i18next";import"./shipment.js";import"lodash/orderBy";import"@shipengine/giger";import"@emotion/react";import"js-base64";import"./checks.js";
1
+ export{R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle.js";export{P as PudoType,l as useBlackboxDetection,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,d as useInsuranceProviderOptions,m as useNestedForm,e as usePackageOptions,f as useRateOptions,n as useRunOnceOnTrue,o as useScrubErrors,g as useServiceCodeOptions,k as useServicePoints,h as useShipmentMetadata,i as useShippingPresetsOptions,j as useWarehouseOptions}from"./use-scrub-errors.js";export{u as useGetServiceName}from"./use-get-service-name.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as useHelpers,b as usePageLayout}from"./use-page-layout.js";import"react";import"./address.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"humps";import"@shipengine/react-api";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"@emotion/react/jsx-runtime";import"react-i18next";import"./shipment.js";import"lodash/orderBy";import"@shipengine/giger";import"@emotion/react";import"js-base64";import"./checks.js";
package/index.js CHANGED
@@ -1 +1 @@
1
- import{E as X,a as _}from"./actions-menu.js";export{z as Actions,y as ActionsMenu,A as AddFundsForm,b as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,d as CarrierConnectionCard,e as CarrierIcon,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,l as EditBillingForm,a as ElementsContext,E as ElementsContextProvider,m as ErrorFallback,F as FieldLabel,n as FormPortal,o as FundAndPurchase,H as HistoryCard,p as HistoryCardExtension,I as InlineLabel,q as ItemsBreakdown,L as LinkAction,r as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,t as SettingsCard,u as SkeletonCarrierRow,v as Spacer,w as Spread,T as Tabs,V as VatForm,W as WalletCard,x as WarehouseForm,c as autoFundingSchema,g as getAddFundsSchema,s as styles,G as useElements}from"./actions-menu.js";export{C as CarrierLogo}from"./carrier-logo.js";export{C as CellFormattedDate,D as Drawer,G as GridController,P as Pager,S as SuspendText,u as usePager}from"./suspend-text.js";export{f as Field,S as StoryNotes}from"./story-notes.js";import{R as Y}from"./use-toggle.js";export{P as Portal,R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle.js";export{C as Country,U as UsState,d as UsaCity,c as countries,a as countryCodes,e as euCountryCodes,p as postalCodeRegex,f as usCities,b as usStateCodes,u as usStates}from"./address.js";export{a as CarrierServices,b as ConnectExternalCarrier,p as PurchaseLabel,s as ShipmentSummary,v as VoidLabel,c as createElement}from"./use-unit-settings.js";export{e as LabelLayout,l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,d as ManageFunding,a as ManageWarehouses,p as PaymentMethodSettings,s as ShipmentsGrid,t as ThemeCreator,T as ThemeCreatorProvider,f as TransactionHistory,c as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{e as extendZod}from"./zod.js";export{P as PudoType,l as useBlackboxDetection,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,d as useInsuranceProviderOptions,m as useNestedForm,e as usePackageOptions,f as useRateOptions,n as useRunOnceOnTrue,o as useScrubErrors,g as useServiceCodeOptions,k as useServicePoints,h as useShipmentMetadata,i as useShippingPresetsOptions,j as useWarehouseOptions}from"./use-scrub-errors.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as useHelpers,b as usePageLayout}from"./use-page-layout.js";export{m as moneySchema}from"./money.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone.js";export{a as assert,r as raise}from"./assertions.js";export{i as isOnboarded}from"./checks.js";export{b as convertDimensions,c as createDictionary,f as formatDimensions,h as getCancelledShipment,d as getIsCustomsRequiredForShipment,g as getIsInternationalShipment,e as getPendingShipment,j as getShipmentByStatus,a as isCollectionService,i as isPudoEligibleRate,m as moveCustomsItemsToProducts}from"./shipment.js";import{_ as Z}from"./carrier.js";export{L as addEmailToValidation,t as addSpaceBetweenWords,w as calculateTotal,k as capitalizeFirstLetter,l as capitalizeFirstLetterOfEachWord,u as currencySymbol,e as daysAfter,S as filterFundingSourceCarriers,a as findDateLocale,b as formatByDateAndLocale,x as formatCreditCardNumber,f as formatDate,c as formatDateDDMMYY,d as formatDateDDMMYYYY,y as formatExpiration,v as formatMoney,O as getCarrierIdByCarrierCode,z as getCurrencyFromString,A as getCurrencySymbolFromString,h as getExpirationYears,P as getLogoOrIconByCarrierCode,B as getRateRequiresAcknowledgement,j as getRelativeDates,C as getTotalRateAmount,g as getlocaleDateStringFormat,E as isDomesticAddress,K as isEmptyAddress,Q as isGlobalPostEligible,F as isMilitaryAddress,i as isNowOrInTheFuture,I as isPoBox,J as isPoBoxAddress,R as isSendleEligible,G as isUnitedStatesTerritory,H as isUnsupportedByUps,N as isUpsCarrier,M as isUspsCarrier,m as mostRecent,n as nextDayCutoff,o as omitTime,D as overrideCarrierCodes,p as parseLocaleDate,q as pascalize,r as replaceSpacesWithDashes,s as sortByCreationDate}from"./carrier.js";export{k as convertDecimalWeightToFractionalWeight,j as convertFractionalWeightToDecimalWeight,h as convertPoundsAndOuncesToOunces,l as convertWeight,c as createCodedErrors,m as formatFractionalWeight,g as getCustomsFromSalesOrder,o as getDefaultWarehouse,b as getIsCustomsRequiredForSalesOrder,d as getRequestedServices,e as getSalesOrderItemsFromSalesOrderOrShipment,f as isDecimalWeight,n as isFlatRatePackageCode,i as isMetricWeightUnit,a as throwAny,t as throwJoinedMessages}from"./warehouses.js";import{g as $,d as ee}from"./vat.js";export{N as NO_VAT_COUNTRIES,c as aggregateRateDetailItems,e as calculateRateDetailBreakdown,h as createStyles,d as deepMergeFeatures,j as errorMap,f as featureFlagComponentNameLookup,a as formLogger,g as getDefaultFeatures,k as getIsVatRequired,i as isObject,b as isString,t as trackingStatusFormatter,v as validationResolver}from"./vat.js";export{a as AccountSettings,l as LabelWorkflow,o as Onboarding}from"./wallet-form.js";import{jsx as ae}from"@emotion/react/jsx-runtime";import{GigerProvider as te,GigerTestProvider as re}from"@shipengine/giger";import{Theme as oe}from"@shipengine/giger-theme";import{ShipEngine as se}from"@shipengine/react-api";import ie from"axios";import{useCallback as ne,useMemo as le}from"react";import"date-fns/isToday";import"react-hook-form";import"react-i18next";import"@emotion/react";import"lodash/isEqual";import"zod";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit";import"card-validator";import"react-dom";import"@tanstack/react-query";import"lodash/merge";import"lodash/mergeWith";import"humps";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";import"lodash/orderBy";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get";import"@hookform/resolvers/zod";var pe={fallback:{borderRadius:{L:"16px",M:"8px",S:"4px",XL:"32px",XS:"2px"},breakPoints:{desktop:1280,mobileLarge:480,tablet:768,tabletLarge:960},card:{borderRadius:{desktop:"8px",mobile:"4px",tablet:"8px"}},components:{Button:{borderRadius:"4px"},Checkbox:{borderRadius:"2px",square:!1},Chip:{backgroundColor:"#f4f4f4",border:"none",borderRadius:"16px",color:"#706f6f",fontWeight:600,isSelected:{backgroundColor:"#EDEDED",border:"none",color:"#7A7A7A"},padding:"4px 16px"},Dialog:{action:{justifyContent:"center"},content:{padding:24,textAlign:"center"},dialog:{backgroundColor:"rgba(0, 0, 0, 0.26)",borderRadius:"4px"},header:{borderBottom:"2px solid #d3d3d3",padding:24,titleColor:"#616161"}},Field:{color:"#373737",fontWeight:700,placeholder:{fontWeight:700}},FieldContainer:{borderRadius:"4px"},Link:{activeColor:"#787878",defaultColor:"#616161",hoverColor:"#303030",isDark:{activeColor:"#787878",defaultColor:"#fff",hoverColor:"#fff",visitedColor:"#fff"},visitedColor:"#303030"},Table:{border:"none",borderRadius:"4px",boxShadow:"0 0 12px rgba(0, 0, 0, 0.1)"},Typography:{body1:{fontSize:"16px",fontWeight:400,letterSpacing:0,lineHeight:"24px"},body2:{fontSize:"14px",fontWeight:400,letterSpacing:3,lineHeight:"20px"},heading1:{fontSize:"48px",fontWeight:700,letterSpacing:0,lineHeight:"72px"},heading2:{fontSize:"32px",fontWeight:700,letterSpacing:1,lineHeight:"48px"},heading3:{fontSize:"24px",fontWeight:700,letterSpacing:3,lineHeight:"48px"},heading4:{fontSize:"20px",fontWeight:700,letterSpacing:3,lineHeight:"32px"},heading5:{fontSize:"18px",fontWeight:700,letterSpacing:3,lineHeight:"28px"},heading6:{fontSize:"16px",fontWeight:700,letterSpacing:3,lineHeight:"24px"},small:{fontSize:"12px",fontWeight:400,letterSpacing:5,lineHeight:"20px"},subtitle1:{fontSize:"16px",fontWeight:600,letterSpacing:3,lineHeight:"24px"},subtitle2:{fontSize:"14px",fontWeight:600,letterSpacing:5,lineHeight:"20px"}}},defaultFontFamily:"Arial",elevations:{above:{boxShadow:"0 0 12px rgba(0, 0, 0, 0.1)",zIndex:1e3},backdrop:{boxShadow:"none",zIndex:1007},flat1:{boxShadow:"0 2px 2px rgba(0, 0, 0, 0.1)",zIndex:1},flat2:{boxShadow:"0 2px 2px rgba(0, 0, 0, 0.1)",zIndex:1e3},overlay1:{boxShadow:"0 0 24px rgba(0, 0, 0, 0.1)",zIndex:1006},overlay2:{boxShadow:"0 0 24px rgba(0, 0, 0, 0.1)",zIndex:1008},popout1:{boxShadow:"0 4px 16px rgba(0, 0, 0, 0.1)",zIndex:1004},popout2:{boxShadow:"0 4px 16px rgba(0, 0, 0, 0.1)",zIndex:1005},raised:{boxShadow:"0 8px 8px rgba(0, 0, 0, 0.1)",zIndex:1002},raisedInverted1:{boxShadow:"0 -8px 8px rgba(0, 0, 0, 0.1)",zIndex:1002},raisedInverted2:{boxShadow:"0 -8px 8px rgba(0, 0, 0, 0.1)",zIndex:1003},sticky:{boxShadow:"none",zIndex:1001}},fontFaces:[],grid:{desktop:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},desktopLarge:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},mobile:{columns:4,gutter:16,horizontalSpace:16,verticalSpace:16},mobileLarge:{columns:4,gutter:16,horizontalSpace:16,verticalSpace:16},tablet:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},tabletLarge:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24}},iconSize:{extra_large:"48px",large:"32px",medium:"20px",regular:"24px",small:"16px"},palette:{alert:{light:"#ffe7ca",main:"#725200"},black:"#000",dataVisualization:{highContrast:{blue:"#3970C1",blueDark:"#002039",coral:"#F95D6A",cyan:"#45CEE0",green:"#B3D849",orange:"#FFA600",orangeDark:"#FF7C43",pink:"#D12771",purple:"#A05195",purpleDark:"#665191"},lowContrast:{blue:"#96B3DE",blueDark:"#5283AB",coral:"#FCA6AD",cyan:"#BAE6FF",green:"#DEF895",orange:"#FDDFA5",orangeDark:"#FCC2A9",pink:"#E995BA",purple:"#D4BBFF",purpleDark:"#B1A2D0"}},error:{light:"#fee5e4",main:"#a72514"},gray:{dark:"#373737",light:"#d3d3d3",main:"#706f6f",megaLight:"#f4f4f4",ultraLight:"#f4f4f4"},info:{light:"#dbedfd",main:"#195f7f"},primary:{dark:"#626262",light:"#D6D6D6",main:"#7A7A7A",ultraLight:"#EDEDED"},secondary:{dark:"#303030",light:"#787878",main:"#616161",ultraLight:"#F4F4F4"},success:{light:"#dcfddb",main:"#286327"},white:"#fff"},spacingBase:8,typography:{fontSize:{L:"18px",M:"16px",S:"14px",XL:"20px",XS:"12px",XXL:"24px",XXS:"10px",XXXL:"32px",XXXXL:"48px"},fontWeight:{bold:700,light:200,normal:400,semibold:600},letterSpacing:{L:3,M:1,S:0,XL:5,XXL:8,XXXL:12},lineHeight:{L:"28px",M:"24px",S:"20px",XL:"32px",XXL:"48px",XXXL:"72px"}}}};const de=({baseURL:e="https://elements.shipengine.com",cdnURL:a="https://cdn.packlink.com",children:t,container:r,features:o,getToken:s,headers:i,locale:n,onApiError:l,onError:p=(()=>{}),scope:d="lmnt",themeConfig:c,defaultQueryClientOptions:g})=>{const m=(({cdnURL:e})=>ne((a=>Z(void 0,void 0,void 0,(function*(){return(yield ie.get(`/brand/fallback/icons/${a.toLowerCase()}.svg`,{baseURL:e,responseType:"json"})).data}))),[e]))({cdnURL:a}),u=new oe(null!=c?c:pe.fallback),h={baseURL:e,cdnURL:a,container:r,features:o,getToken:s,locale:n,onError:p,scope:d,theme:u};return ae(X,Object.assign({},h,{children:ae(te,Object.assign({cdnUrl:a,reference:d||void 0,resolveIcon:m,theme:u},{children:ae(se,Object.assign({baseURL:e,defaultQueryClientOptions:g,getToken:s,headers:i,onApiError:l},{children:ae(Y,{children:t})}))}))}))},ce=({baseURL:e,children:a,features:t})=>{const r=le((()=>new oe),[]),o=$(["globalFeatures"]),s=ne((()=>"none"),[]),i={baseURL:e,cdnURL:"mockCdnUrl",getFeatures:e=>{var a;return ee(null!==(a=$([e]))&&void 0!==a?a:{},null==t?void 0:t[e])},getToken:s,globalFeatures:Object.assign(Object.assign({enabledExternalCarriers:["apc","asendia","better_trucks","canpar","chronopost","couriers_please","courierpost","dpd","hermes_germany","intelliquick_delivery","lso","ontrac","seko","ups","yodel"]},o),t.globalFeatures),onError:()=>{},scope:"lmnt",theme:r};return ae(_.Provider,Object.assign({value:i},{children:ae(re,Object.assign({theme:r},{children:ae(se,Object.assign({baseURL:e,getToken:s},{children:a}))}))}))};export{de as ElementsProvider,ce as ElementsTestProvider};
1
+ import{E as X,a as _}from"./actions-menu.js";export{z as Actions,y as ActionsMenu,A as AddFundsForm,b as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,d as CarrierConnectionCard,e as CarrierIcon,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,l as EditBillingForm,a as ElementsContext,E as ElementsContextProvider,m as ErrorFallback,F as FieldLabel,n as FormPortal,o as FundAndPurchase,H as HistoryCard,p as HistoryCardExtension,I as InlineLabel,q as ItemsBreakdown,L as LinkAction,r as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,t as SettingsCard,u as SkeletonCarrierRow,v as Spacer,w as Spread,T as Tabs,V as VatForm,W as WalletCard,x as WarehouseForm,c as autoFundingSchema,g as getAddFundsSchema,s as styles,G as useElements}from"./actions-menu.js";export{C as CarrierLogo}from"./carrier-logo.js";export{C as CellFormattedDate,D as Drawer,G as GridController,b as GridFilters,a as GridFooter,P as Pager,u as usePager}from"./usePager.js";export{f as Field,S as StoryNotes,a as SuspendText}from"./suspend-text.js";import{R as Y}from"./use-toggle.js";export{P as Portal,R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle.js";export{C as Country,U as UsState,d as UsaCity,c as countries,a as countryCodes,e as euCountryCodes,p as postalCodeRegex,f as usCities,b as usStateCodes,u as usStates}from"./address.js";export{a as CarrierServices,b as ConnectExternalCarrier,p as PurchaseLabel,s as ShipmentSummary,v as VoidLabel,c as createElement}from"./use-unit-settings.js";export{e as LabelLayout,l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,d as ManageFunding,a as ManageWarehouses,p as PaymentMethodSettings,s as ShipmentsGrid,t as ThemeCreator,T as ThemeCreatorProvider,f as TransactionHistory,c as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{e as extendZod}from"./zod.js";export{P as PudoType,l as useBlackboxDetection,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,d as useInsuranceProviderOptions,m as useNestedForm,e as usePackageOptions,f as useRateOptions,n as useRunOnceOnTrue,o as useScrubErrors,g as useServiceCodeOptions,k as useServicePoints,h as useShipmentMetadata,i as useShippingPresetsOptions,j as useWarehouseOptions}from"./use-scrub-errors.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as useHelpers,b as usePageLayout}from"./use-page-layout.js";export{u as useGetServiceName}from"./use-get-service-name.js";export{m as moneySchema}from"./money.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone.js";export{a as assert,r as raise}from"./assertions.js";export{i as isOnboarded}from"./checks.js";export{b as convertDimensions,c as createDictionary,f as formatDimensions,h as getCancelledShipment,d as getIsCustomsRequiredForShipment,g as getIsInternationalShipment,e as getPendingShipment,j as getShipmentByStatus,a as isCollectionService,i as isPudoEligibleRate,m as moveCustomsItemsToProducts}from"./shipment.js";import{_ as Z}from"./carrier.js";export{L as addEmailToValidation,t as addSpaceBetweenWords,w as calculateTotal,k as capitalizeFirstLetter,l as capitalizeFirstLetterOfEachWord,u as currencySymbol,e as daysAfter,S as filterFundingSourceCarriers,a as findDateLocale,b as formatByDateAndLocale,x as formatCreditCardNumber,f as formatDate,c as formatDateDDMMYY,d as formatDateDDMMYYYY,y as formatExpiration,v as formatMoney,O as getCarrierIdByCarrierCode,z as getCurrencyFromString,A as getCurrencySymbolFromString,h as getExpirationYears,P as getLogoOrIconByCarrierCode,B as getRateRequiresAcknowledgement,j as getRelativeDates,C as getTotalRateAmount,g as getlocaleDateStringFormat,E as isDomesticAddress,K as isEmptyAddress,Q as isGlobalPostEligible,F as isMilitaryAddress,i as isNowOrInTheFuture,I as isPoBox,J as isPoBoxAddress,R as isSendleEligible,G as isUnitedStatesTerritory,H as isUnsupportedByUps,N as isUpsCarrier,M as isUspsCarrier,m as mostRecent,n as nextDayCutoff,o as omitTime,D as overrideCarrierCodes,p as parseLocaleDate,q as pascalize,r as replaceSpacesWithDashes,s as sortByCreationDate}from"./carrier.js";export{k as convertDecimalWeightToFractionalWeight,j as convertFractionalWeightToDecimalWeight,h as convertPoundsAndOuncesToOunces,l as convertWeight,c as createCodedErrors,m as formatFractionalWeight,g as getCustomsFromSalesOrder,o as getDefaultWarehouse,b as getIsCustomsRequiredForSalesOrder,d as getRequestedServices,e as getSalesOrderItemsFromSalesOrderOrShipment,f as isDecimalWeight,n as isFlatRatePackageCode,i as isMetricWeightUnit,a as throwAny,t as throwJoinedMessages}from"./warehouses.js";import{g as $,d as ee}from"./vat.js";export{N as NO_VAT_COUNTRIES,c as aggregateRateDetailItems,e as calculateRateDetailBreakdown,h as createStyles,d as deepMergeFeatures,j as errorMap,f as featureFlagComponentNameLookup,a as formLogger,g as getDefaultFeatures,k as getIsVatRequired,i as isObject,b as isString,t as trackingStatusFormatter,v as validationResolver}from"./vat.js";export{a as AccountSettings,l as LabelWorkflow,o as Onboarding}from"./wallet-form.js";import{jsx as ae}from"@emotion/react/jsx-runtime";import{GigerProvider as te,GigerTestProvider as re}from"@shipengine/giger";import{Theme as se}from"@shipengine/giger-theme";import{ShipEngine as oe}from"@shipengine/react-api";import ie from"axios";import{useCallback as ne,useMemo as le}from"react";import"date-fns/isToday";import"react-hook-form";import"react-i18next";import"@emotion/react";import"lodash/isEqual";import"zod";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit";import"card-validator";import"react-use";import"react-dom";import"@tanstack/react-query";import"lodash/merge";import"lodash/mergeWith";import"humps";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";import"lodash/orderBy";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get";import"@hookform/resolvers/zod";var pe={fallback:{borderRadius:{L:"16px",M:"8px",S:"4px",XL:"32px",XS:"2px"},breakPoints:{desktop:1280,mobileLarge:480,tablet:768,tabletLarge:960},card:{borderRadius:{desktop:"8px",mobile:"4px",tablet:"8px"}},components:{Button:{borderRadius:"4px"},Checkbox:{borderRadius:"2px",square:!1},Chip:{backgroundColor:"#f4f4f4",border:"none",borderRadius:"16px",color:"#706f6f",fontWeight:600,isSelected:{backgroundColor:"#EDEDED",border:"none",color:"#7A7A7A"},padding:"4px 16px"},Dialog:{action:{justifyContent:"center"},content:{padding:24,textAlign:"center"},dialog:{backgroundColor:"rgba(0, 0, 0, 0.26)",borderRadius:"4px"},header:{borderBottom:"2px solid #d3d3d3",padding:24,titleColor:"#616161"}},Field:{color:"#373737",fontWeight:700,placeholder:{fontWeight:700}},FieldContainer:{borderRadius:"4px"},Link:{activeColor:"#787878",defaultColor:"#616161",hoverColor:"#303030",isDark:{activeColor:"#787878",defaultColor:"#fff",hoverColor:"#fff",visitedColor:"#fff"},visitedColor:"#303030"},Table:{border:"none",borderRadius:"4px",boxShadow:"0 0 12px rgba(0, 0, 0, 0.1)"},Typography:{body1:{fontSize:"16px",fontWeight:400,letterSpacing:0,lineHeight:"24px"},body2:{fontSize:"14px",fontWeight:400,letterSpacing:3,lineHeight:"20px"},heading1:{fontSize:"48px",fontWeight:700,letterSpacing:0,lineHeight:"72px"},heading2:{fontSize:"32px",fontWeight:700,letterSpacing:1,lineHeight:"48px"},heading3:{fontSize:"24px",fontWeight:700,letterSpacing:3,lineHeight:"48px"},heading4:{fontSize:"20px",fontWeight:700,letterSpacing:3,lineHeight:"32px"},heading5:{fontSize:"18px",fontWeight:700,letterSpacing:3,lineHeight:"28px"},heading6:{fontSize:"16px",fontWeight:700,letterSpacing:3,lineHeight:"24px"},small:{fontSize:"12px",fontWeight:400,letterSpacing:5,lineHeight:"20px"},subtitle1:{fontSize:"16px",fontWeight:600,letterSpacing:3,lineHeight:"24px"},subtitle2:{fontSize:"14px",fontWeight:600,letterSpacing:5,lineHeight:"20px"}}},defaultFontFamily:"Arial",elevations:{above:{boxShadow:"0 0 12px rgba(0, 0, 0, 0.1)",zIndex:1e3},backdrop:{boxShadow:"none",zIndex:1007},flat1:{boxShadow:"0 2px 2px rgba(0, 0, 0, 0.1)",zIndex:1},flat2:{boxShadow:"0 2px 2px rgba(0, 0, 0, 0.1)",zIndex:1e3},overlay1:{boxShadow:"0 0 24px rgba(0, 0, 0, 0.1)",zIndex:1006},overlay2:{boxShadow:"0 0 24px rgba(0, 0, 0, 0.1)",zIndex:1008},popout1:{boxShadow:"0 4px 16px rgba(0, 0, 0, 0.1)",zIndex:1004},popout2:{boxShadow:"0 4px 16px rgba(0, 0, 0, 0.1)",zIndex:1005},raised:{boxShadow:"0 8px 8px rgba(0, 0, 0, 0.1)",zIndex:1002},raisedInverted1:{boxShadow:"0 -8px 8px rgba(0, 0, 0, 0.1)",zIndex:1002},raisedInverted2:{boxShadow:"0 -8px 8px rgba(0, 0, 0, 0.1)",zIndex:1003},sticky:{boxShadow:"none",zIndex:1001}},fontFaces:[],grid:{desktop:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},desktopLarge:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},mobile:{columns:4,gutter:16,horizontalSpace:16,verticalSpace:16},mobileLarge:{columns:4,gutter:16,horizontalSpace:16,verticalSpace:16},tablet:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},tabletLarge:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24}},iconSize:{extra_large:"48px",large:"32px",medium:"20px",regular:"24px",small:"16px"},palette:{alert:{light:"#ffe7ca",main:"#725200"},black:"#000",dataVisualization:{highContrast:{blue:"#3970C1",blueDark:"#002039",coral:"#F95D6A",cyan:"#45CEE0",green:"#B3D849",orange:"#FFA600",orangeDark:"#FF7C43",pink:"#D12771",purple:"#A05195",purpleDark:"#665191"},lowContrast:{blue:"#96B3DE",blueDark:"#5283AB",coral:"#FCA6AD",cyan:"#BAE6FF",green:"#DEF895",orange:"#FDDFA5",orangeDark:"#FCC2A9",pink:"#E995BA",purple:"#D4BBFF",purpleDark:"#B1A2D0"}},error:{light:"#fee5e4",main:"#a72514"},gray:{dark:"#373737",light:"#d3d3d3",main:"#706f6f",megaLight:"#f4f4f4",ultraLight:"#f4f4f4"},info:{light:"#dbedfd",main:"#195f7f"},primary:{dark:"#626262",light:"#D6D6D6",main:"#7A7A7A",ultraLight:"#EDEDED"},secondary:{dark:"#303030",light:"#787878",main:"#616161",ultraLight:"#F4F4F4"},success:{light:"#dcfddb",main:"#286327"},white:"#fff"},spacingBase:8,typography:{fontSize:{L:"18px",M:"16px",S:"14px",XL:"20px",XS:"12px",XXL:"24px",XXS:"10px",XXXL:"32px",XXXXL:"48px"},fontWeight:{bold:700,light:200,normal:400,semibold:600},letterSpacing:{L:3,M:1,S:0,XL:5,XXL:8,XXXL:12},lineHeight:{L:"28px",M:"24px",S:"20px",XL:"32px",XXL:"48px",XXXL:"72px"}}}};const de=({baseURL:e="https://elements.shipengine.com",cdnURL:a="https://cdn.packlink.com",children:t,container:r,features:s,getToken:o,headers:i,locale:n,onApiError:l,onError:p=(()=>{}),scope:d="lmnt",themeConfig:c,defaultQueryClientOptions:g})=>{const m=(({cdnURL:e})=>ne((a=>Z(void 0,void 0,void 0,(function*(){return(yield ie.get(`/brand/fallback/icons/${a.toLowerCase()}.svg`,{baseURL:e,responseType:"json"})).data}))),[e]))({cdnURL:a}),u=new se(null!=c?c:pe.fallback),h={baseURL:e,cdnURL:a,container:r,features:s,getToken:o,locale:n,onError:p,scope:d,theme:u};return ae(X,Object.assign({},h,{children:ae(te,Object.assign({cdnUrl:a,reference:d||void 0,resolveIcon:m,theme:u},{children:ae(oe,Object.assign({baseURL:e,defaultQueryClientOptions:g,getToken:o,headers:i,onApiError:l},{children:ae(Y,{children:t})}))}))}))},ce=({baseURL:e,children:a,features:t})=>{const r=le((()=>new se),[]),s=$(["globalFeatures"]),o=ne((()=>"none"),[]),i={baseURL:e,cdnURL:"mockCdnUrl",getFeatures:e=>{var a;return ee(null!==(a=$([e]))&&void 0!==a?a:{},null==t?void 0:t[e])},getToken:o,globalFeatures:Object.assign(Object.assign({enabledExternalCarriers:["apc","asendia","better_trucks","canpar","chronopost","couriers_please","courierpost","dpd","hermes_germany","intelliquick_delivery","lso","ontrac","seko","ups","yodel"]},s),t.globalFeatures),onError:()=>{},scope:"lmnt",theme:r};return ae(_.Provider,Object.assign({value:i},{children:ae(re,Object.assign({theme:r},{children:ae(oe,Object.assign({baseURL:e,getToken:o},{children:a}))}))}))};export{de as ElementsProvider,ce as ElementsTestProvider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "peerDependencies": {
5
5
  "@emotion/react": "11.x",
6
6
  "react-i18next": "11.x",
@@ -37,9 +37,10 @@
37
37
  "@rjsf/validator-ajv8": "5.16.1",
38
38
  "@shipengine/giger": "1.15.0",
39
39
  "@shipengine/giger-theme": "1.6.0",
40
- "@shipengine/js-api": "1.30.2",
41
- "@shipengine/react-api": "2.15.3",
40
+ "@shipengine/js-api": "2.0.1",
41
+ "@shipengine/react-api": "3.1.2",
42
42
  "@storybook/addons": "6.5.16",
43
+ "@storybook/api": "6.5.16",
43
44
  "@storybook/components": "7.0.0-rc.1",
44
45
  "@storybook/core-events": "7.0.0-rc.1",
45
46
  "@storybook/manager-api": "7.0.0-rc.1",
@@ -58,6 +59,7 @@
58
59
  "libphonenumber-js": "1.10.14",
59
60
  "lodash": "4.17.21",
60
61
  "react-hook-form": "7.40.0",
62
+ "react-use": "17.4.2",
61
63
  "rollup-plugin-copy": "3.4.0",
62
64
  "stylis": "4.1.3",
63
65
  "use-debounce": "10.0.0",
@@ -14,6 +14,7 @@ export type FieldControllerProps<NP, TFieldValues extends FieldValues = FieldVal
14
14
  inputOnly?: boolean;
15
15
  isOptional?: boolean;
16
16
  label: string;
17
+ labelPosition?: FieldLabelProps["position"];
17
18
  labelWeight?: FieldLabelProps["weight"];
18
19
  labelWidth?: FieldLabelProps["width"];
19
20
  nativeLabel?: boolean;
@@ -21,7 +22,7 @@ export type FieldControllerProps<NP, TFieldValues extends FieldValues = FieldVal
21
22
  type FieldControllerOptions = {
22
23
  inputOnly?: boolean;
23
24
  };
24
- export declare const createFieldController: <P>(options?: FieldControllerOptions) => <TFieldValues extends FieldValues = FieldValues, TName extends import("react-hook-form").Path<TFieldValues> = import("react-hook-form").Path<TFieldValues>>({ children, control, defaultValue, displayErrors, displayLabel, errors: errorsProp, hint, inputOnly, isOptional, label, labelInfo, labelWeight, labelWidth, name, nativeLabel, rules, shouldUnregister, subLabel, ...formInputProps }: FieldControllerProps<P, TFieldValues, TName>) => JSX.Element;
25
+ export declare const createFieldController: <P>(options?: FieldControllerOptions) => <TFieldValues extends FieldValues = FieldValues, TName extends import("react-hook-form").Path<TFieldValues> = import("react-hook-form").Path<TFieldValues>>({ children, control, defaultValue, displayErrors, displayLabel, errors: errorsProp, hint, inputOnly, isOptional, label, labelInfo, labelWeight, labelWidth, labelPosition, name, nativeLabel, rules, shouldUnregister, subLabel, ...formInputProps }: FieldControllerProps<P, TFieldValues, TName>) => JSX.Element;
25
26
  export type ControlledFieldProps = Parameters<ControlledField>[0];
26
27
  export type ControlledField<NP = object, CP = object, OK extends string = ""> = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(fieldProps: Omit<FieldControllerProps<NP, TFieldValues, TName>, "children" | OK> & CP) => JSX.Element;
27
28
  export {};
@@ -8,6 +8,7 @@ export type FieldLabelProps = {
8
8
  children: React.ReactNode;
9
9
  label?: string;
10
10
  labelInfo?: React.ReactNode;
11
+ position?: "horizontal" | "vertical";
11
12
  subLabel?: string;
12
13
  weight?: "bold" | "normal";
13
14
  width?: string | number;
@@ -18,4 +19,4 @@ export type FieldLabelProps = {
18
19
  *
19
20
  * # Field Label Component
20
21
  */
21
- export declare const FieldLabel: ({ children, label, labelInfo, subLabel, weight, withInput, width, }: FieldLabelProps) => import("@emotion/react/jsx-runtime").JSX.Element;
22
+ export declare const FieldLabel: ({ children, label, labelInfo, subLabel, weight, withInput, position, width, }: FieldLabelProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,4 +1,20 @@
1
1
  export declare const styles: {
2
+ getLabel: ({ withInput, subLabel, width, isVertical, }: {
3
+ isVertical?: boolean | undefined;
4
+ subLabel?: string | undefined;
5
+ width?: string | number | undefined;
6
+ withInput?: boolean | undefined;
7
+ }) => (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
8
+ flexShrink: number;
9
+ paddingTop: number | undefined;
10
+ width: string | number;
11
+ };
12
+ getWrapper: (isVertical: boolean) => (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
13
+ flexDirection?: "column" | undefined;
14
+ gap: number;
15
+ display: "flex";
16
+ width: string;
17
+ };
2
18
  iconTooltip: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
3
19
  color: string;
4
20
  marginLeft: number;
@@ -1,14 +1,32 @@
1
1
  import { ReactNode } from "react";
2
- type ColumnProps<T> = {
2
+ export type ColumnProps<T> = {
3
3
  headerContent: ReactNode;
4
4
  renderCellContent: (data: T) => ReactNode;
5
5
  };
6
+ /**
7
+ * @internal
8
+ *
9
+ * # Grid Props
10
+ *
11
+ * @see {@link GridController | The `<GridController />` component}
12
+ */
6
13
  type GridProps<T extends object> = {
7
14
  columns: ColumnProps<T>[];
8
15
  data: T[];
16
+ emptyContent?: ReactNode;
17
+ filters?: ReactNode;
9
18
  footerContent?: ReactNode;
10
19
  onRowClick?: (data: T) => void;
11
20
  useCheckboxes?: boolean;
12
21
  };
13
- export declare const GridController: <T extends object>({ columns, data, footerContent, onRowClick, useCheckboxes, }: GridProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
22
+ /**
23
+ * @internal
24
+ *
25
+ * # Grid Controller
26
+ *
27
+ * - The `<GridController />` component is used to facilitate the display of data in a grid format.
28
+ *
29
+ * @see {@link GridProps | The props for the `<GridController />` component}
30
+ */
31
+ export declare const GridController: <T extends object>({ columns, data, footerContent, onRowClick, useCheckboxes, filters, emptyContent, }: GridProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
14
32
  export {};
@@ -1,11 +1,23 @@
1
1
  export declare const styles: {
2
- checkboxHeader: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
3
- width: number;
2
+ getCheckboxHeader: (theme: any) => {
3
+ width: any;
4
4
  };
5
+ getFilters: (theme: any) => {
6
+ borderBottom: string;
7
+ padding: string;
8
+ };
9
+ getTableHeader: (theme: any) => {
10
+ background: any;
11
+ };
12
+ getWrapper: (theme: any) => any;
5
13
  table: {
6
- "*": {
7
- overflow: "hidden";
8
- textOverflow: "clip !important";
9
- };
14
+ tableLayout: "initial";
15
+ };
16
+ tableFooter: {
17
+ borderTop: string;
18
+ justifyContent: "space-between";
19
+ };
20
+ tableWrapper: {
21
+ border: string;
10
22
  };
11
23
  };
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * @internal
4
+ *
5
+ * # Grid Footer Props
6
+ *
7
+ * @see {@link GridFooter | The `<GridFooter />` component}
8
+ */
9
+ interface GridFooterProps {
10
+ onPageChange: (nextPage: number) => void;
11
+ page: number;
12
+ pages: number;
13
+ pageSize: number;
14
+ showPagination: boolean;
15
+ total: number;
16
+ }
17
+ /**
18
+ * @internal
19
+ *
20
+ * # GridFooter
21
+ *
22
+ * - The `<GridFooter />` component that handle grid footer with pagination.
23
+ *
24
+ * @see {@link GridFooterProps | The props for the `<GridFooter />` component}
25
+ */
26
+ export declare const GridFooter: ({ page, pages, pageSize, total, showPagination, onPageChange, }: GridFooterProps) => JSX.Element;
27
+ export {};
@@ -1,2 +1,4 @@
1
1
  export * from "./grid-controller";
2
2
  export * from "./cell-formatted-date";
3
+ export * from "./grid-footer";
4
+ export type { ColumnProps } from "./grid-controller";
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @internal
3
+ *
4
+ * # Grid Filters Props
5
+ *
6
+ * @see {@link GridFilters | The `<GridFilters />` component}
7
+ */
8
+ type GridFilterProps = {
9
+ filters: IGridFilters;
10
+ onClearAllFilters: () => void;
11
+ onFiltersUpdated: (params: IGridFilters) => void;
12
+ };
13
+ export type IGridFilter<T> = {
14
+ enabled: boolean;
15
+ value: T | null;
16
+ };
17
+ export interface IGridFilters {
18
+ shipmentId: IGridFilter<string>;
19
+ }
20
+ /**
21
+ * @internal
22
+ *
23
+ * # GridFilters
24
+ *
25
+ * - The `<GridFilters />` component includes Filters used in ShipmentsGrid and LabelsGrid component.
26
+ *
27
+ * @see {@link GridFiltersProps | The props for the `<GridFilters />` component}
28
+ */
29
+ export declare const GridFilters: ({ filters, onFiltersUpdated, onClearAllFilters }: GridFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
30
+ export {};
@@ -0,0 +1,11 @@
1
+ export declare const styles: {
2
+ getButtons: (theme: any) => {
3
+ display: "flex";
4
+ gap: any;
5
+ justifyContent: "flex-end";
6
+ };
7
+ getLabel: (theme: any) => {
8
+ display: "inline-block";
9
+ marginBottom: any;
10
+ };
11
+ };
@@ -0,0 +1,2 @@
1
+ export { GridFilters } from './grid-filters';
2
+ export type { IGridFilters } from './grid-filters';
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+ export declare const shipmentIdFormSchema: z.ZodObject<{
3
+ shipmentId: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ shipmentId: string;
6
+ }, {
7
+ shipmentId: string;
8
+ }>;
9
+ export type ShipmentIdFormFields = z.input<typeof shipmentIdFormSchema>;
@@ -0,0 +1,23 @@
1
+ import { IGridFilters } from "./grid-filters";
2
+ /**
3
+ * @internal
4
+ *
5
+ * # Shipment Id Filter Props
6
+ *
7
+ * @see {@link ShipmentIdFilter | The `<ShipmentIdFilter />` component}
8
+ */
9
+ type ShipmentIdFilterProps = {
10
+ filters: IGridFilters;
11
+ onFiltersUpdated: (params: IGridFilters) => void;
12
+ };
13
+ /**
14
+ * @internal
15
+ *
16
+ * # ShipmentIdFilter
17
+ *
18
+ * - The `<ShipmentIdFilter />` component handle shipment id filter used in Shipments Grid.
19
+ *
20
+ * @see {@link ShipmentIdFilterProps | The props for the `<ShipmentIdFilter />` component}
21
+ */
22
+ export declare const ShipmentIdFilter: ({ filters, onFiltersUpdated }: ShipmentIdFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -19,6 +19,7 @@ export * from "./field";
19
19
  export * from "./form-portal";
20
20
  export * from "./fund-and-purchase";
21
21
  export * from "./grid-controller";
22
+ export * from "./grid-filters";
22
23
  export * from "./history";
23
24
  export * from "./inline-label";
24
25
  export * from "./items-breakdown";
@@ -523,15 +523,33 @@ export declare const Element: ({ resources, ...props }: object & {
523
523
  title: string;
524
524
  headers: {
525
525
  created: string;
526
- download: string;
527
- labelId: string;
528
- service: string;
529
- shipTo: string;
526
+ shipmentId: string;
527
+ parcels: string;
528
+ recipient: string;
529
+ shipping: string;
530
+ shipDate: string;
531
+ status: string;
532
+ };
533
+ empty: {
534
+ title: string;
535
+ subtitle: string;
536
+ };
537
+ emptyWithFilters: {
538
+ title: string;
539
+ subtitle: string;
540
+ button: string;
541
+ };
542
+ status: {
543
+ voided: string;
544
+ error: string;
545
+ completed: string;
546
+ processing: string;
530
547
  };
531
548
  actions: {
532
- download: {
533
- pdf: string;
534
- };
549
+ title: string;
550
+ print: string;
551
+ void: string;
552
+ printForms: string;
535
553
  };
536
554
  };
537
555
  "connect-carrier": {
@@ -751,6 +769,13 @@ export declare const Element: ({ resources, ...props }: object & {
751
769
  "row-count_one": string;
752
770
  "row-count_other": string;
753
771
  rows: string;
772
+ clearAll: string;
773
+ shipmentId: string;
774
+ shipmentIdFilter: string;
775
+ apply: string;
776
+ clear: string;
777
+ search: string;
778
+ shipmentIdHint: string;
754
779
  };
755
780
  insuranceProviders: {
756
781
  carrier: string;
@@ -826,6 +851,7 @@ export declare const Element: ({ resources, ...props }: object & {
826
851
  requiredList: string;
827
852
  tooFewCharacters: string;
828
853
  tooManyCharacters: string;
854
+ requiredShipmentId: string;
829
855
  };
830
856
  shippingPresets: {
831
857
  apply: string;
@@ -0,0 +1,67 @@
1
+ /// <reference types="react" />
2
+ import { LabelsGridProps } from "../";
3
+ import { IGridFilters } from "../../../components";
4
+ export declare const useLabelsGrid: ({ labelStatus, showShipmentIdFilter }: LabelsGridProps) => {
5
+ clearAllFilters: () => void;
6
+ filters: IGridFilters;
7
+ isAnyFilterActive: boolean;
8
+ isLoading: boolean;
9
+ labels: {
10
+ serviceName: string | null | undefined;
11
+ alternativeIdentifiers?: string[] | undefined;
12
+ batchId: string;
13
+ carrierCode: string;
14
+ carrierId: string;
15
+ chargeEvent: import("@shipengine/react-api").LabelChargeEvent;
16
+ createdAt: string;
17
+ displayScheme: import("@shipengine/react-api").LabelDisplayScheme;
18
+ formDownload: import("@shipengine/react-api").LinkedResource;
19
+ insuranceClaim: import("@shipengine/react-api").LinkedResource;
20
+ insuranceCost: import("@shipengine/react-api").Money;
21
+ isInternational: boolean;
22
+ isReturnLabel: boolean;
23
+ labelDownload: import("@shipengine/react-api").Download;
24
+ labelFormat: import("@shipengine/react-api").LabelFormat;
25
+ labelId: string;
26
+ labelImageId: string;
27
+ labelLayout: import("@shipengine/react-api").LabelLayout;
28
+ packageCode: string;
29
+ packages: import("@shipengine/react-api").ShipmentPackage[];
30
+ paperlessDownload: import("@shipengine/react-api").PaperlessDownload | null;
31
+ qrCodeDownload?: import("@shipengine/react-api").LinkedResource | undefined;
32
+ rateDetails: import("@shipengine/react-api").RateDetail[];
33
+ relayPoints: {
34
+ shipFrom: import("@shipengine/react-api").RelayPoint;
35
+ shipTo: import("@shipengine/react-api").RelayPoint;
36
+ };
37
+ requestedComparisonAmount?: import("@shipengine/react-api").Money | undefined;
38
+ rmaNumber: string;
39
+ serviceCode: string;
40
+ shipDate: string;
41
+ shipmentCost: import("@shipengine/react-api").Money;
42
+ shipmentId: string;
43
+ shippingRuleId: string | null;
44
+ shipTo: import("@shipengine/react-api").Address;
45
+ status: import("@shipengine/react-api").LabelStatus;
46
+ trackable: boolean;
47
+ trackingNumber: string;
48
+ trackingStatus: string;
49
+ trackingUrl: string;
50
+ voided: boolean;
51
+ voidedAt: string | null;
52
+ }[];
53
+ pageConfig: {
54
+ currentPage: number;
55
+ pagerProps: {
56
+ currentPage: number;
57
+ currentPageSize: number;
58
+ onPageSelect: (page: number) => void;
59
+ onPageSizeSelect: (pageSize: number) => void;
60
+ };
61
+ pagesAmount: number;
62
+ pageSize: number;
63
+ totalElements: number;
64
+ };
65
+ setFilters: import("react").Dispatch<import("react").SetStateAction<IGridFilters>>;
66
+ shouldShowFilters: boolean;
67
+ };
@@ -1 +1,2 @@
1
1
  export * as LabelsGrid from "./labels-grid";
2
+ export type { LabelsGridProps } from "./labels-grid";