@integration-app/react 2.0.3-beta.0 → 2.0.3-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/_modules/awesome-debounce-promise.cjs +20 -0
- package/dist/cjs/components/Integrations/IntegrationAvatar/index.cjs +57 -0
- package/dist/cjs/components/Integrations/IntegrationItem/index.cjs +56 -0
- package/dist/cjs/components/Integrations/IntegrationItemSkeleton.cjs +45 -0
- package/dist/cjs/contexts/integration-app-context.cjs +48 -0
- package/dist/cjs/hooks/actions/useAction.cjs +37 -0
- package/dist/cjs/hooks/actions/useActionInstance.cjs +51 -0
- package/dist/cjs/hooks/actions/useActionInstances.cjs +21 -0
- package/dist/cjs/hooks/actions/useActions.cjs +21 -0
- package/dist/cjs/hooks/app-data-schemas/useAppDataSchema.cjs +23 -0
- package/dist/cjs/hooks/app-data-schemas/useAppDataSchemaInstance.cjs +38 -0
- package/dist/cjs/hooks/app-data-schemas/useAppDataSchemaInstances.cjs +24 -0
- package/dist/cjs/hooks/app-data-schemas/useAppDataSchemas.cjs +21 -0
- package/dist/cjs/hooks/app-events/useAppEventSubscription.cjs +23 -0
- package/dist/cjs/hooks/app-events/useAppEventSubscriptions.cjs +24 -0
- package/dist/cjs/hooks/app-events/useAppEventType.cjs +23 -0
- package/dist/cjs/hooks/app-events/useAppEventTypes.cjs +21 -0
- package/dist/cjs/hooks/app-events/useAppEvents.cjs +21 -0
- package/dist/cjs/hooks/customers/useCustomer.cjs +23 -0
- package/dist/cjs/hooks/customers/useCustomers.cjs +21 -0
- package/dist/cjs/hooks/data-collections/useDataCollectionSpec.cjs +31 -0
- package/dist/cjs/hooks/data-links/useDataLinkTable.cjs +23 -0
- package/dist/cjs/hooks/data-links/useDataLinkTableInstance.cjs +36 -0
- package/dist/cjs/hooks/data-links/useDataLinkTableInstances.cjs +24 -0
- package/dist/cjs/hooks/data-links/useDataLinkTables.cjs +21 -0
- package/dist/cjs/hooks/data-sources/useDataSource.cjs +37 -0
- package/dist/cjs/hooks/data-sources/useDataSourceInstance.cjs +79 -0
- package/dist/cjs/hooks/data-sources/useDataSourceInstanceCollection.cjs +32 -0
- package/dist/cjs/hooks/data-sources/useDataSourceInstances.cjs +24 -0
- package/dist/cjs/hooks/data-sources/useDataSources.cjs +21 -0
- package/dist/cjs/hooks/external-events/useExternalEventSubscription.cjs +58 -0
- package/dist/cjs/hooks/external-events/useExternalEventSubscriptions.cjs +24 -0
- package/dist/cjs/hooks/field-mappings/useFieldMapping.cjs +37 -0
- package/dist/cjs/hooks/field-mappings/useFieldMappingInstance.cjs +47 -0
- package/dist/cjs/hooks/field-mappings/useFieldMappingInstances.cjs +24 -0
- package/dist/cjs/hooks/field-mappings/useFieldMappings.cjs +21 -0
- package/dist/cjs/hooks/flows/useFlow.cjs +37 -0
- package/dist/cjs/hooks/flows/useFlowInstance.cjs +65 -0
- package/dist/cjs/hooks/flows/useFlowInstances.cjs +21 -0
- package/dist/cjs/hooks/flows/useFlowRun.cjs +35 -0
- package/dist/cjs/hooks/flows/useFlowRuns.cjs +21 -0
- package/dist/cjs/hooks/flows/useFlows.cjs +21 -0
- package/dist/cjs/hooks/integrations/useConnection.cjs +26 -0
- package/dist/cjs/hooks/integrations/useConnections.cjs +21 -0
- package/dist/cjs/hooks/integrations/useConnectorSpec.cjs +23 -0
- package/dist/cjs/hooks/integrations/useIntegration.cjs +23 -0
- package/dist/cjs/hooks/integrations/useIntegrations.cjs +21 -0
- package/dist/cjs/hooks/scenarios/useScenario.cjs +23 -0
- package/dist/cjs/hooks/scenarios/useScenarios.cjs +21 -0
- package/dist/cjs/hooks/screens/useScreen.cjs +23 -0
- package/dist/cjs/hooks/useElement.cjs +124 -0
- package/dist/cjs/hooks/useElements.cjs +76 -0
- package/dist/cjs/hooks/useIntegrationAppSWR.cjs +23 -0
- package/dist/cjs/index.cjs +129 -0
- package/dist/cjs/styled-system/css/conditions.cjs +47 -0
- package/dist/cjs/styled-system/css/css.cjs +58 -0
- package/dist/cjs/styled-system/css/cva.cjs +100 -0
- package/dist/cjs/styled-system/css/cx.cjs +24 -0
- package/dist/cjs/styled-system/helpers.cjs +300 -0
- package/dist/cjs/styled-system/jsx/box.cjs +24 -0
- package/dist/cjs/styled-system/jsx/center.cjs +24 -0
- package/dist/cjs/styled-system/jsx/circle.cjs +24 -0
- package/dist/cjs/styled-system/jsx/factory-helper.cjs +36 -0
- package/dist/cjs/styled-system/jsx/factory.cjs +93 -0
- package/dist/cjs/styled-system/jsx/flex.cjs +24 -0
- package/dist/cjs/styled-system/jsx/is-valid-prop.cjs +24 -0
- package/dist/cjs/styled-system/jsx/visually-hidden.cjs +24 -0
- package/dist/cjs/styled-system/patterns/box.cjs +23 -0
- package/dist/cjs/styled-system/patterns/center.cjs +29 -0
- package/dist/cjs/styled-system/patterns/circle.cjs +33 -0
- package/dist/cjs/styled-system/patterns/flex.cjs +34 -0
- package/dist/cjs/styled-system/patterns/visually-hidden.cjs +26 -0
- package/dist/cjs/styled-system/recipes/avatar.cjs +64 -0
- package/dist/cjs/styled-system/recipes/button.cjs +54 -0
- package/dist/cjs/styled-system/recipes/create-recipe.cjs +94 -0
- package/dist/cjs/styled-system/recipes/icon.cjs +46 -0
- package/dist/cjs/styled-system/recipes/skeleton.cjs +35 -0
- package/dist/cjs/styled-system/recipes/spinner.cjs +45 -0
- package/dist/cjs/styled-system/recipes/text.cjs +52 -0
- package/dist/cjs/ui-kit/avatar.cjs +40 -0
- package/dist/cjs/ui-kit/button.cjs +44 -0
- package/dist/cjs/ui-kit/spinner.cjs +36 -0
- package/dist/cjs/ui-kit/styled/avatar.cjs +31 -0
- package/dist/cjs/ui-kit/styled/button.cjs +22 -0
- package/dist/cjs/ui-kit/styled/icon.cjs +24 -0
- package/dist/cjs/ui-kit/styled/skeleton.cjs +34 -0
- package/dist/cjs/ui-kit/styled/spinner.cjs +22 -0
- package/dist/cjs/ui-kit/styled/text.cjs +21 -0
- package/dist/cjs/ui-kit/styled/utils/create-style-context.cjs +76 -0
- package/dist/esm/_modules/awesome-debounce-promise.mjs +16 -0
- package/dist/esm/components/Integrations/IntegrationAvatar/index.mjs +55 -0
- package/dist/esm/components/Integrations/IntegrationItem/index.mjs +54 -0
- package/dist/esm/components/Integrations/IntegrationItemSkeleton.mjs +43 -0
- package/dist/esm/contexts/integration-app-context.mjs +45 -0
- package/dist/esm/hooks/actions/useAction.mjs +35 -0
- package/dist/esm/hooks/actions/useActionInstance.mjs +49 -0
- package/dist/esm/hooks/actions/useActionInstances.mjs +19 -0
- package/dist/esm/hooks/actions/useActions.mjs +19 -0
- package/dist/esm/hooks/app-data-schemas/useAppDataSchema.mjs +21 -0
- package/dist/esm/hooks/app-data-schemas/useAppDataSchemaInstance.mjs +36 -0
- package/dist/esm/hooks/app-data-schemas/useAppDataSchemaInstances.mjs +22 -0
- package/dist/esm/hooks/app-data-schemas/useAppDataSchemas.mjs +19 -0
- package/dist/esm/hooks/app-events/useAppEventSubscription.mjs +21 -0
- package/dist/esm/hooks/app-events/useAppEventSubscriptions.mjs +22 -0
- package/dist/esm/hooks/app-events/useAppEventType.mjs +21 -0
- package/dist/esm/hooks/app-events/useAppEventTypes.mjs +19 -0
- package/dist/esm/hooks/app-events/useAppEvents.mjs +19 -0
- package/dist/esm/hooks/customers/useCustomer.mjs +21 -0
- package/dist/esm/hooks/customers/useCustomers.mjs +19 -0
- package/dist/esm/hooks/data-collections/useDataCollectionSpec.mjs +29 -0
- package/dist/esm/hooks/data-links/useDataLinkTable.mjs +21 -0
- package/dist/esm/hooks/data-links/useDataLinkTableInstance.mjs +34 -0
- package/dist/esm/hooks/data-links/useDataLinkTableInstances.mjs +22 -0
- package/dist/esm/hooks/data-links/useDataLinkTables.mjs +19 -0
- package/dist/esm/hooks/data-sources/useDataSource.mjs +35 -0
- package/dist/esm/hooks/data-sources/useDataSourceInstance.mjs +77 -0
- package/dist/esm/hooks/data-sources/useDataSourceInstanceCollection.mjs +30 -0
- package/dist/esm/hooks/data-sources/useDataSourceInstances.mjs +22 -0
- package/dist/esm/hooks/data-sources/useDataSources.mjs +19 -0
- package/dist/esm/hooks/external-events/useExternalEventSubscription.mjs +56 -0
- package/dist/esm/hooks/external-events/useExternalEventSubscriptions.mjs +22 -0
- package/dist/esm/hooks/field-mappings/useFieldMapping.mjs +35 -0
- package/dist/esm/hooks/field-mappings/useFieldMappingInstance.mjs +45 -0
- package/dist/esm/hooks/field-mappings/useFieldMappingInstances.mjs +22 -0
- package/dist/esm/hooks/field-mappings/useFieldMappings.mjs +19 -0
- package/dist/esm/hooks/flows/useFlow.mjs +35 -0
- package/dist/esm/hooks/flows/useFlowInstance.mjs +63 -0
- package/dist/esm/hooks/flows/useFlowInstances.mjs +19 -0
- package/dist/esm/hooks/flows/useFlowRun.mjs +33 -0
- package/dist/esm/hooks/flows/useFlowRuns.mjs +19 -0
- package/dist/esm/hooks/flows/useFlows.mjs +19 -0
- package/dist/esm/hooks/integrations/useConnection.mjs +24 -0
- package/dist/esm/hooks/integrations/useConnections.mjs +19 -0
- package/dist/esm/hooks/integrations/useConnectorSpec.mjs +21 -0
- package/dist/esm/hooks/integrations/useIntegration.mjs +21 -0
- package/dist/esm/hooks/integrations/useIntegrations.mjs +19 -0
- package/dist/esm/hooks/scenarios/useScenario.mjs +21 -0
- package/dist/esm/hooks/scenarios/useScenarios.mjs +19 -0
- package/dist/esm/hooks/screens/useScreen.mjs +21 -0
- package/dist/esm/hooks/useElement.mjs +122 -0
- package/dist/esm/hooks/useElements.mjs +74 -0
- package/dist/esm/hooks/useIntegrationAppSWR.mjs +21 -0
- package/dist/esm/index.mjs +62 -0
- package/dist/esm/styled-system/css/conditions.mjs +43 -0
- package/dist/esm/styled-system/css/css.mjs +54 -0
- package/dist/esm/styled-system/css/cva.mjs +96 -0
- package/dist/esm/styled-system/css/cx.mjs +22 -0
- package/dist/esm/styled-system/helpers.mjs +280 -0
- package/dist/esm/styled-system/jsx/box.mjs +22 -0
- package/dist/esm/styled-system/jsx/center.mjs +22 -0
- package/dist/esm/styled-system/jsx/circle.mjs +22 -0
- package/dist/esm/styled-system/jsx/factory-helper.mjs +31 -0
- package/dist/esm/styled-system/jsx/factory.mjs +91 -0
- package/dist/esm/styled-system/jsx/flex.mjs +22 -0
- package/dist/esm/styled-system/jsx/is-valid-prop.mjs +21 -0
- package/dist/esm/styled-system/jsx/visually-hidden.mjs +22 -0
- package/dist/esm/styled-system/patterns/box.mjs +21 -0
- package/dist/esm/styled-system/patterns/center.mjs +27 -0
- package/dist/esm/styled-system/patterns/circle.mjs +31 -0
- package/dist/esm/styled-system/patterns/flex.mjs +32 -0
- package/dist/esm/styled-system/patterns/visually-hidden.mjs +24 -0
- package/dist/esm/styled-system/recipes/avatar.mjs +62 -0
- package/dist/esm/styled-system/recipes/button.mjs +52 -0
- package/dist/esm/styled-system/recipes/create-recipe.mjs +91 -0
- package/dist/esm/styled-system/recipes/icon.mjs +44 -0
- package/dist/esm/styled-system/recipes/skeleton.mjs +33 -0
- package/dist/esm/styled-system/recipes/spinner.mjs +43 -0
- package/dist/esm/styled-system/recipes/text.mjs +50 -0
- package/dist/esm/ui-kit/avatar.mjs +38 -0
- package/dist/esm/ui-kit/button.mjs +42 -0
- package/dist/esm/ui-kit/spinner.mjs +34 -0
- package/dist/esm/ui-kit/styled/avatar.mjs +24 -0
- package/dist/esm/ui-kit/styled/button.mjs +20 -0
- package/dist/esm/ui-kit/styled/icon.mjs +22 -0
- package/dist/esm/ui-kit/styled/skeleton.mjs +32 -0
- package/dist/esm/ui-kit/styled/spinner.mjs +20 -0
- package/dist/esm/ui-kit/styled/text.mjs +19 -0
- package/dist/esm/ui-kit/styled/utils/create-style-context.mjs +74 -0
- package/dist/styles.css +13918 -0
- package/dist/types/_modules/awesome-debounce-promise.d.ts +2 -0
- package/dist/types/components/Integrations/IntegrationAvatar/index.d.ts +6 -0
- package/dist/types/components/Integrations/IntegrationItem/index.d.ts +8 -0
- package/dist/types/components/Integrations/IntegrationItemSkeleton.d.ts +4 -0
- package/dist/types/components/Integrations/index.d.ts +3 -0
- package/dist/types/contexts/index.d.ts +2 -0
- package/dist/types/contexts/integration-app-context.d.ts +14 -0
- package/dist/types/hooks/actions/useAction.d.ts +16 -0
- package/dist/types/hooks/actions/useActionInstance.d.ts +18 -0
- package/dist/types/hooks/actions/useActionInstances.d.ts +11 -0
- package/dist/types/hooks/actions/useActions.d.ts +11 -0
- package/dist/types/hooks/app-data-schemas/useAppDataSchema.d.ts +14 -0
- package/dist/types/hooks/app-data-schemas/useAppDataSchemaInstance.d.ts +15 -0
- package/dist/types/hooks/app-data-schemas/useAppDataSchemaInstances.d.ts +11 -0
- package/dist/types/hooks/app-data-schemas/useAppDataSchemas.d.ts +11 -0
- package/dist/types/hooks/app-events/useAppEventSubscription.d.ts +14 -0
- package/dist/types/hooks/app-events/useAppEventSubscriptions.d.ts +11 -0
- package/dist/types/hooks/app-events/useAppEventType.d.ts +15 -0
- package/dist/types/hooks/app-events/useAppEventTypes.d.ts +11 -0
- package/dist/types/hooks/app-events/useAppEvents.d.ts +11 -0
- package/dist/types/hooks/customers/useCustomer.d.ts +14 -0
- package/dist/types/hooks/customers/useCustomers.d.ts +11 -0
- package/dist/types/hooks/data-collections/useDataCollectionSpec.d.ts +6 -0
- package/dist/types/hooks/data-form/index.d.ts +1 -0
- package/dist/types/hooks/data-links/useDataLinkTable.d.ts +14 -0
- package/dist/types/hooks/data-links/useDataLinkTableInstance.d.ts +17 -0
- package/dist/types/hooks/data-links/useDataLinkTableInstances.d.ts +11 -0
- package/dist/types/hooks/data-links/useDataLinkTables.d.ts +11 -0
- package/dist/types/hooks/data-sources/useDataSource.d.ts +16 -0
- package/dist/types/hooks/data-sources/useDataSourceInstance.d.ts +25 -0
- package/dist/types/hooks/data-sources/useDataSourceInstanceCollection.d.ts +7 -0
- package/dist/types/hooks/data-sources/useDataSourceInstances.d.ts +11 -0
- package/dist/types/hooks/data-sources/useDataSources.d.ts +11 -0
- package/dist/types/hooks/external-events/useExternalEventSubscription.d.ts +19 -0
- package/dist/types/hooks/external-events/useExternalEventSubscriptions.d.ts +11 -0
- package/dist/types/hooks/field-mappings/useFieldMapping.d.ts +16 -0
- package/dist/types/hooks/field-mappings/useFieldMappingInstance.d.ts +17 -0
- package/dist/types/hooks/field-mappings/useFieldMappingInstances.d.ts +11 -0
- package/dist/types/hooks/field-mappings/useFieldMappings.d.ts +11 -0
- package/dist/types/hooks/flows/useFlow.d.ts +16 -0
- package/dist/types/hooks/flows/useFlowInstance.d.ts +21 -0
- package/dist/types/hooks/flows/useFlowInstances.d.ts +11 -0
- package/dist/types/hooks/flows/useFlowRun.d.ts +8 -0
- package/dist/types/hooks/flows/useFlowRuns.d.ts +11 -0
- package/dist/types/hooks/flows/useFlows.d.ts +11 -0
- package/dist/types/hooks/integrations/useConnection.d.ts +14 -0
- package/dist/types/hooks/integrations/useConnections.d.ts +11 -0
- package/dist/types/hooks/integrations/useConnectorSpec.d.ts +6 -0
- package/dist/types/hooks/integrations/useIntegration.d.ts +14 -0
- package/dist/types/hooks/integrations/useIntegrations.d.ts +11 -0
- package/dist/types/hooks/scenarios/useScenario.d.ts +14 -0
- package/dist/types/hooks/scenarios/useScenarios.d.ts +11 -0
- package/dist/types/hooks/screens/useScreen.d.ts +14 -0
- package/dist/types/hooks/useElement.d.ts +22 -0
- package/dist/types/hooks/useElements.d.ts +9 -0
- package/dist/types/hooks/useIntegrationAppSWR.d.ts +1 -0
- package/dist/types/index.d.ts +52 -0
- package/dist/types/storybook-helpers/withColorPalette.d.ts +6 -0
- package/dist/types/styled-system/css/css.d.ts +22 -0
- package/dist/types/styled-system/css/cva.d.ts +6 -0
- package/dist/types/styled-system/css/cx.d.ts +5 -0
- package/dist/types/styled-system/css/index.d.ts +5 -0
- package/dist/types/styled-system/css/sva.d.ts +4 -0
- package/dist/types/styled-system/jsx/aspect-ratio.d.ts +10 -0
- package/dist/types/styled-system/jsx/bleed.d.ts +10 -0
- package/dist/types/styled-system/jsx/box.d.ts +10 -0
- package/dist/types/styled-system/jsx/center.d.ts +10 -0
- package/dist/types/styled-system/jsx/circle.d.ts +10 -0
- package/dist/types/styled-system/jsx/container.d.ts +10 -0
- package/dist/types/styled-system/jsx/cq.d.ts +10 -0
- package/dist/types/styled-system/jsx/divider.d.ts +10 -0
- package/dist/types/styled-system/jsx/factory.d.ts +3 -0
- package/dist/types/styled-system/jsx/flex.d.ts +10 -0
- package/dist/types/styled-system/jsx/float.d.ts +10 -0
- package/dist/types/styled-system/jsx/grid-item.d.ts +10 -0
- package/dist/types/styled-system/jsx/grid.d.ts +10 -0
- package/dist/types/styled-system/jsx/hstack.d.ts +10 -0
- package/dist/types/styled-system/jsx/index.d.ts +24 -0
- package/dist/types/styled-system/jsx/is-valid-prop.d.ts +11 -0
- package/dist/types/styled-system/jsx/link-overlay.d.ts +10 -0
- package/dist/types/styled-system/jsx/spacer.d.ts +10 -0
- package/dist/types/styled-system/jsx/square.d.ts +10 -0
- package/dist/types/styled-system/jsx/stack.d.ts +10 -0
- package/dist/types/styled-system/jsx/visually-hidden.d.ts +10 -0
- package/dist/types/styled-system/jsx/vstack.d.ts +10 -0
- package/dist/types/styled-system/jsx/wrap.d.ts +10 -0
- package/dist/types/styled-system/patterns/aspect-ratio.d.ts +21 -0
- package/dist/types/styled-system/patterns/bleed.d.ts +22 -0
- package/dist/types/styled-system/patterns/box.d.ts +21 -0
- package/dist/types/styled-system/patterns/center.d.ts +21 -0
- package/dist/types/styled-system/patterns/circle.d.ts +21 -0
- package/dist/types/styled-system/patterns/container.d.ts +21 -0
- package/dist/types/styled-system/patterns/cq.d.ts +22 -0
- package/dist/types/styled-system/patterns/divider.d.ts +23 -0
- package/dist/types/styled-system/patterns/flex.d.ts +27 -0
- package/dist/types/styled-system/patterns/float.d.ts +24 -0
- package/dist/types/styled-system/patterns/grid-item.d.ts +26 -0
- package/dist/types/styled-system/patterns/grid.d.ts +25 -0
- package/dist/types/styled-system/patterns/hstack.d.ts +22 -0
- package/dist/types/styled-system/patterns/index.d.ts +21 -0
- package/dist/types/styled-system/patterns/link-overlay.d.ts +21 -0
- package/dist/types/styled-system/patterns/spacer.d.ts +21 -0
- package/dist/types/styled-system/patterns/square.d.ts +21 -0
- package/dist/types/styled-system/patterns/stack.d.ts +24 -0
- package/dist/types/styled-system/patterns/visually-hidden.d.ts +21 -0
- package/dist/types/styled-system/patterns/vstack.d.ts +22 -0
- package/dist/types/styled-system/patterns/wrap.d.ts +25 -0
- package/dist/types/styled-system/recipes/accordion.d.ts +31 -0
- package/dist/types/styled-system/recipes/alert.d.ts +28 -0
- package/dist/types/styled-system/recipes/avatar.d.ts +31 -0
- package/dist/types/styled-system/recipes/badge.d.ts +35 -0
- package/dist/types/styled-system/recipes/button.d.ts +35 -0
- package/dist/types/styled-system/recipes/card.d.ts +28 -0
- package/dist/types/styled-system/recipes/carousel.d.ts +31 -0
- package/dist/types/styled-system/recipes/checkbox.d.ts +31 -0
- package/dist/types/styled-system/recipes/clipboard.d.ts +28 -0
- package/dist/types/styled-system/recipes/code.d.ts +35 -0
- package/dist/types/styled-system/recipes/collapsible.d.ts +28 -0
- package/dist/types/styled-system/recipes/color-picker.d.ts +28 -0
- package/dist/types/styled-system/recipes/combobox.d.ts +31 -0
- package/dist/types/styled-system/recipes/date-picker.d.ts +28 -0
- package/dist/types/styled-system/recipes/dialog.d.ts +28 -0
- package/dist/types/styled-system/recipes/drawer.d.ts +31 -0
- package/dist/types/styled-system/recipes/editable.d.ts +28 -0
- package/dist/types/styled-system/recipes/field.d.ts +28 -0
- package/dist/types/styled-system/recipes/fieldset.d.ts +28 -0
- package/dist/types/styled-system/recipes/file-upload.d.ts +28 -0
- package/dist/types/styled-system/recipes/form-label.d.ts +31 -0
- package/dist/types/styled-system/recipes/hover-card.d.ts +28 -0
- package/dist/types/styled-system/recipes/icon.d.ts +31 -0
- package/dist/types/styled-system/recipes/index.d.ts +54 -0
- package/dist/types/styled-system/recipes/input.d.ts +31 -0
- package/dist/types/styled-system/recipes/kbd.d.ts +31 -0
- package/dist/types/styled-system/recipes/link.d.ts +28 -0
- package/dist/types/styled-system/recipes/menu.d.ts +31 -0
- package/dist/types/styled-system/recipes/number-input.d.ts +31 -0
- package/dist/types/styled-system/recipes/pagination.d.ts +28 -0
- package/dist/types/styled-system/recipes/pin-input.d.ts +31 -0
- package/dist/types/styled-system/recipes/popover.d.ts +28 -0
- package/dist/types/styled-system/recipes/progress.d.ts +31 -0
- package/dist/types/styled-system/recipes/qr-code.d.ts +28 -0
- package/dist/types/styled-system/recipes/radio-button-group.d.ts +35 -0
- package/dist/types/styled-system/recipes/radio-group.d.ts +31 -0
- package/dist/types/styled-system/recipes/rating-group.d.ts +31 -0
- package/dist/types/styled-system/recipes/segment-group.d.ts +31 -0
- package/dist/types/styled-system/recipes/select.d.ts +35 -0
- package/dist/types/styled-system/recipes/signature-pad.d.ts +28 -0
- package/dist/types/styled-system/recipes/skeleton.d.ts +28 -0
- package/dist/types/styled-system/recipes/slider.d.ts +31 -0
- package/dist/types/styled-system/recipes/spinner.d.ts +31 -0
- package/dist/types/styled-system/recipes/splitter.d.ts +28 -0
- package/dist/types/styled-system/recipes/switch-recipe.d.ts +31 -0
- package/dist/types/styled-system/recipes/table.d.ts +35 -0
- package/dist/types/styled-system/recipes/tabs.d.ts +35 -0
- package/dist/types/styled-system/recipes/tags-input.d.ts +31 -0
- package/dist/types/styled-system/recipes/text.d.ts +29 -0
- package/dist/types/styled-system/recipes/textarea.d.ts +31 -0
- package/dist/types/styled-system/recipes/toast.d.ts +28 -0
- package/dist/types/styled-system/recipes/toggle-group.d.ts +35 -0
- package/dist/types/styled-system/recipes/tooltip.d.ts +28 -0
- package/dist/types/styled-system/recipes/tree-view.d.ts +28 -0
- package/dist/types/styled-system/tokens/index.d.ts +9 -0
- package/dist/types/styled-system/tokens/tokens.d.ts +60 -0
- package/dist/types/styled-system/types/composition.d.ts +138 -0
- package/dist/types/styled-system/types/conditions.d.ts +264 -0
- package/dist/{index.d.ts → types/styled-system/types/csstype.d.ts} +9623 -8900
- package/dist/types/styled-system/types/global.d.ts +19 -0
- package/dist/types/styled-system/types/index.d.ts +8 -0
- package/dist/types/styled-system/types/jsx.d.ts +52 -0
- package/dist/types/styled-system/types/parts.d.ts +8 -0
- package/dist/types/styled-system/types/pattern.d.ts +78 -0
- package/dist/types/styled-system/types/prop-type.d.ts +245 -0
- package/dist/types/styled-system/types/recipe.d.ts +181 -0
- package/dist/types/styled-system/types/selectors.d.ts +59 -0
- package/dist/types/styled-system/types/static-css.d.ts +51 -0
- package/dist/types/styled-system/types/style-props.d.ts +7468 -0
- package/dist/types/styled-system/types/system-types.d.ts +109 -0
- package/dist/types/ui-kit/avatar.d.ts +6 -0
- package/dist/types/ui-kit/button.d.ts +9 -0
- package/dist/types/ui-kit/icon.d.ts +1 -0
- package/dist/types/ui-kit/skeleton.d.ts +1 -0
- package/dist/types/ui-kit/spinner.d.ts +5 -0
- package/dist/types/ui-kit/styled/avatar.d.ts +12 -0
- package/dist/types/ui-kit/styled/button.d.ts +5 -0
- package/dist/types/ui-kit/styled/icon.d.ts +5 -0
- package/dist/types/ui-kit/styled/skeleton.d.ts +7 -0
- package/dist/types/ui-kit/styled/spinner.d.ts +5 -0
- package/dist/types/ui-kit/styled/text.d.ts +8 -0
- package/dist/types/ui-kit/styled/utils/create-style-context.d.ts +20 -0
- package/dist/types/ui-kit/text.d.ts +1 -0
- package/dist/types/utils/types.d.ts +8 -0
- package/package.json +41 -26
- package/dist/index.js +0 -1543
- package/dist/index.js.map +0 -1
- package/dist/index.module.d.mts +0 -20575
- package/dist/index.module.mjs +0 -1484
- package/dist/index.module.mjs.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/index.module.mjs
DELETED
@@ -1,1484 +0,0 @@
|
|
1
|
-
import { IntegrationAppClient, parseDataLocationPath } from '@integration-app/sdk';
|
2
|
-
export * from '@integration-app/sdk';
|
3
|
-
export { DataForm } from '@integration-app/sdk';
|
4
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
5
|
-
import { createContext, useMemo, useContext, useState, forwardRef, createElement } from 'react';
|
6
|
-
import useSWR from 'swr';
|
7
|
-
import AwesomeDebouncePromiseImport from 'awesome-debounce-promise';
|
8
|
-
import useSWRInfinite from 'swr/infinite';
|
9
|
-
import qs from 'query-string';
|
10
|
-
import { ark } from '@ark-ui/react';
|
11
|
-
|
12
|
-
const IntegrationAppContext = createContext(null);
|
13
|
-
IntegrationAppContext.displayName = 'IntegrationAppClientContext';
|
14
|
-
const IntegrationAppProvider = ({ token, fetchToken, credentials, fetchCredentials, apiUri = null, uiUri = null, children, }) => {
|
15
|
-
const client = useMemo(() => new IntegrationAppClient({
|
16
|
-
token,
|
17
|
-
fetchToken,
|
18
|
-
credentials,
|
19
|
-
fetchCredentials,
|
20
|
-
apiUri,
|
21
|
-
uiUri,
|
22
|
-
}), [token, JSON.stringify(credentials), apiUri, uiUri]);
|
23
|
-
return (jsx(IntegrationAppContext.Provider, { value: client, children: children }));
|
24
|
-
};
|
25
|
-
function useIntegrationApp() {
|
26
|
-
return useContext(IntegrationAppContext);
|
27
|
-
}
|
28
|
-
|
29
|
-
function useIntegrationAppSWR(path, options) {
|
30
|
-
const client = useIntegrationApp();
|
31
|
-
const fetcher = async () => {
|
32
|
-
const response = await client.get(path, options);
|
33
|
-
return response;
|
34
|
-
};
|
35
|
-
return useSWR(client ? path : undefined, fetcher, options);
|
36
|
-
}
|
37
|
-
|
38
|
-
const AwesomeDebouncePromise = AwesomeDebouncePromiseImport?.default ?? AwesomeDebouncePromiseImport;
|
39
|
-
|
40
|
-
const elementStateCache = new Map();
|
41
|
-
function useElement(selector, accessorGenerator) {
|
42
|
-
const integrationApp = useIntegrationApp();
|
43
|
-
const elementKeyData = {
|
44
|
-
token: integrationApp?.token,
|
45
|
-
selector,
|
46
|
-
};
|
47
|
-
const elementKey = JSON.stringify(elementKeyData);
|
48
|
-
const elementState = elementStateCache.get(elementKey) ?? {
|
49
|
-
updatedLocally: false,
|
50
|
-
savingToServer: false,
|
51
|
-
currentPutRequests: [],
|
52
|
-
debouncedPut: AwesomeDebouncePromise(async (data) => {
|
53
|
-
const requestId = Math.random();
|
54
|
-
elementState.currentPutRequests.push(requestId);
|
55
|
-
elementState.updatedLocally = false;
|
56
|
-
elementState.savingToServer = true;
|
57
|
-
try {
|
58
|
-
const result = await accessor?.put(data);
|
59
|
-
elementState.currentPutRequests =
|
60
|
-
elementState.currentPutRequests.filter((id) => id !== requestId);
|
61
|
-
if (!elementState.updatedLocally &&
|
62
|
-
elementState.currentPutRequests.length === 0) {
|
63
|
-
elementState.savingToServer = false;
|
64
|
-
await mutate(result, false);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
catch (e) {
|
68
|
-
elementState.updatedLocally = true;
|
69
|
-
throw e;
|
70
|
-
}
|
71
|
-
finally {
|
72
|
-
elementState.savingToServer = false;
|
73
|
-
}
|
74
|
-
}, 500),
|
75
|
-
};
|
76
|
-
if (!elementStateCache.has(elementKey)) {
|
77
|
-
elementStateCache.set(elementKey, elementState);
|
78
|
-
}
|
79
|
-
const accessor = integrationApp
|
80
|
-
? accessorGenerator(integrationApp)
|
81
|
-
: undefined;
|
82
|
-
const swrKey = accessor && selector ? `element:${elementKey}` : undefined;
|
83
|
-
const { data: item, mutate, error, isLoading, isValidating, } = useSWR(swrKey, () => accessor?.get(), {
|
84
|
-
isPaused: () => elementState.updatedLocally || elementState.savingToServer,
|
85
|
-
});
|
86
|
-
const loading = isLoading;
|
87
|
-
const refreshing = isValidating;
|
88
|
-
async function refresh() {
|
89
|
-
return await mutate();
|
90
|
-
}
|
91
|
-
async function put(data) {
|
92
|
-
if (!accessor?.put) {
|
93
|
-
throw new Error(`"put method is not supported for accessor ${accessor.constructor.name}`);
|
94
|
-
}
|
95
|
-
elementState.updatedLocally = true;
|
96
|
-
const newLocalData = {
|
97
|
-
...item,
|
98
|
-
...data,
|
99
|
-
};
|
100
|
-
await mutate(newLocalData, false);
|
101
|
-
await elementState.debouncedPut(data);
|
102
|
-
}
|
103
|
-
async function patch(data) {
|
104
|
-
const newData = {
|
105
|
-
...item,
|
106
|
-
...data,
|
107
|
-
};
|
108
|
-
return put(newData);
|
109
|
-
}
|
110
|
-
async function archive() {
|
111
|
-
if (!accessor?.archive) {
|
112
|
-
return;
|
113
|
-
}
|
114
|
-
await mutate({ ...item, archivedAt: new Date().toISOString() }, false);
|
115
|
-
await accessor?.archive();
|
116
|
-
await mutate();
|
117
|
-
}
|
118
|
-
async function create(data) {
|
119
|
-
if (!accessor?.create) {
|
120
|
-
throw new Error(`"create method is not supported for accessor ${accessor?.constructor.name}`);
|
121
|
-
}
|
122
|
-
const result = await accessor?.create(data);
|
123
|
-
return await mutate(result);
|
124
|
-
}
|
125
|
-
return {
|
126
|
-
accessor,
|
127
|
-
item,
|
128
|
-
loading,
|
129
|
-
saving: elementState.updatedLocally || elementState.savingToServer,
|
130
|
-
error,
|
131
|
-
refresh,
|
132
|
-
refreshing,
|
133
|
-
create,
|
134
|
-
patch,
|
135
|
-
put,
|
136
|
-
archive,
|
137
|
-
};
|
138
|
-
}
|
139
|
-
|
140
|
-
function useConnection(id) {
|
141
|
-
const { item: connection, ...rest } = useElement(id, (integrationApp) => (id ? integrationApp.connection(id) : undefined));
|
142
|
-
return {
|
143
|
-
connection,
|
144
|
-
...rest,
|
145
|
-
};
|
146
|
-
}
|
147
|
-
|
148
|
-
function useElements(route, query = {}) {
|
149
|
-
const integrationApp = useIntegrationApp();
|
150
|
-
const limit = query.limit ?? 25;
|
151
|
-
const tokenHash = hashCode(integrationApp.token);
|
152
|
-
function getKey(page, previousPageData) {
|
153
|
-
if (page === 0)
|
154
|
-
return `/${route}?${qs.stringify({
|
155
|
-
...query,
|
156
|
-
limit,
|
157
|
-
hash: tokenHash,
|
158
|
-
})}`;
|
159
|
-
if (previousPageData.items?.length < limit)
|
160
|
-
return null;
|
161
|
-
return `/${route}?${qs.stringify({
|
162
|
-
...query,
|
163
|
-
limit,
|
164
|
-
cursor: previousPageData.cursor,
|
165
|
-
hash: tokenHash,
|
166
|
-
})}`;
|
167
|
-
}
|
168
|
-
const [loadingMore, setIsLoadingMore] = useState(false);
|
169
|
-
const { data, size, setSize, isLoading, error, mutate, isValidating } = useSWRInfinite(getKey, (url) => integrationApp.get(url));
|
170
|
-
const items = data ? data.map((page) => page.items).flat() : [];
|
171
|
-
const loading = isLoading;
|
172
|
-
const refreshing = isValidating;
|
173
|
-
async function loadMore() {
|
174
|
-
const hasMoreToLoad = data[size - 1]?.items?.length === limit;
|
175
|
-
if (hasMoreToLoad) {
|
176
|
-
setIsLoadingMore(true);
|
177
|
-
await setSize(size + 1);
|
178
|
-
setIsLoadingMore(false);
|
179
|
-
}
|
180
|
-
}
|
181
|
-
async function refresh() {
|
182
|
-
await mutate();
|
183
|
-
}
|
184
|
-
return {
|
185
|
-
items,
|
186
|
-
refresh,
|
187
|
-
refreshing,
|
188
|
-
loadMore,
|
189
|
-
loadingMore,
|
190
|
-
loading,
|
191
|
-
error,
|
192
|
-
};
|
193
|
-
}
|
194
|
-
function hashCode(s) {
|
195
|
-
if (!s) {
|
196
|
-
return 0;
|
197
|
-
}
|
198
|
-
const l = s.length;
|
199
|
-
let h = 0, i = 0;
|
200
|
-
if (l > 0)
|
201
|
-
while (i < l)
|
202
|
-
h = ((h << 5) - h + s.charCodeAt(i++)) | 0;
|
203
|
-
return h;
|
204
|
-
}
|
205
|
-
|
206
|
-
function useConnections(query) {
|
207
|
-
const { ...rest } = useElements('connections', query);
|
208
|
-
return {
|
209
|
-
connections: rest.items,
|
210
|
-
...rest,
|
211
|
-
};
|
212
|
-
}
|
213
|
-
|
214
|
-
function useConnectorSpec(integrationIdOrKey) {
|
215
|
-
const integrationApp = useIntegrationApp();
|
216
|
-
const { data, isLoading, error } = useSWR(integrationIdOrKey
|
217
|
-
? `/integrations/${integrationIdOrKey}/connector-spec`
|
218
|
-
: undefined, () => integrationApp.integration(integrationIdOrKey).getConnectorSpec());
|
219
|
-
return { data, loading: isLoading, error };
|
220
|
-
}
|
221
|
-
|
222
|
-
function useIntegration(idOrKey) {
|
223
|
-
const { item: integration, ...rest } = useElement(idOrKey, (integrationApp) => idOrKey ? integrationApp.integration(idOrKey) : undefined);
|
224
|
-
return { integration, ...rest };
|
225
|
-
}
|
226
|
-
|
227
|
-
function useIntegrations(query) {
|
228
|
-
const { ...rest } = useElements('integrations', query);
|
229
|
-
return {
|
230
|
-
integrations: rest.items,
|
231
|
-
...rest,
|
232
|
-
};
|
233
|
-
}
|
234
|
-
|
235
|
-
function useFieldMapping(selector) {
|
236
|
-
const { item: fieldMapping, accessor, refresh, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.fieldMapping(selector) : undefined);
|
237
|
-
async function apply(integrationKeys) {
|
238
|
-
const result = await accessor?.apply(integrationKeys);
|
239
|
-
await refresh();
|
240
|
-
return result ?? [];
|
241
|
-
}
|
242
|
-
async function reset() {
|
243
|
-
await accessor?.reset();
|
244
|
-
await refresh();
|
245
|
-
}
|
246
|
-
return { fieldMapping, apply, reset, refresh, accessor, ...rest };
|
247
|
-
}
|
248
|
-
|
249
|
-
function useFieldMappingInstance(selector) {
|
250
|
-
const { item: fieldMappingInstance, accessor, refresh, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.fieldMappingInstance(selector) : undefined);
|
251
|
-
async function setup() {
|
252
|
-
await accessor?.setup();
|
253
|
-
await refresh();
|
254
|
-
}
|
255
|
-
async function reset() {
|
256
|
-
await accessor?.reset();
|
257
|
-
await refresh();
|
258
|
-
}
|
259
|
-
async function openConfiguration(options) {
|
260
|
-
return accessor?.openConfiguration(options);
|
261
|
-
}
|
262
|
-
return {
|
263
|
-
fieldMappingInstance,
|
264
|
-
accessor,
|
265
|
-
refresh,
|
266
|
-
setup,
|
267
|
-
reset,
|
268
|
-
openConfiguration,
|
269
|
-
...rest,
|
270
|
-
};
|
271
|
-
}
|
272
|
-
|
273
|
-
function useFieldMappingInstances(query) {
|
274
|
-
const { ...rest } = useElements('field-mapping-instances', query);
|
275
|
-
return {
|
276
|
-
fieldMappingInstances: rest.items,
|
277
|
-
...rest,
|
278
|
-
};
|
279
|
-
}
|
280
|
-
|
281
|
-
function useFieldMappings(query) {
|
282
|
-
const { ...rest } = useElements('field-mappings', query);
|
283
|
-
return {
|
284
|
-
fieldMappings: rest.items,
|
285
|
-
...rest,
|
286
|
-
};
|
287
|
-
}
|
288
|
-
|
289
|
-
function useDataSource(selector) {
|
290
|
-
const { item: dataSource, refresh, accessor, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.dataSource(selector) : undefined);
|
291
|
-
async function apply(integrationKeys) {
|
292
|
-
const result = await accessor?.apply(integrationKeys);
|
293
|
-
await refresh();
|
294
|
-
return result ?? [];
|
295
|
-
}
|
296
|
-
async function reset() {
|
297
|
-
await accessor?.reset();
|
298
|
-
await refresh();
|
299
|
-
}
|
300
|
-
return { dataSource, apply, reset, refresh, accessor, ...rest };
|
301
|
-
}
|
302
|
-
|
303
|
-
function useDataSourceInstance(selector) {
|
304
|
-
const { item: dataSourceInstance, accessor, refresh, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.dataSourceInstance(selector) : undefined);
|
305
|
-
async function setup() {
|
306
|
-
await accessor?.setup();
|
307
|
-
await refresh();
|
308
|
-
}
|
309
|
-
async function reset() {
|
310
|
-
await accessor?.reset();
|
311
|
-
await refresh();
|
312
|
-
}
|
313
|
-
async function openConfiguration(options) {
|
314
|
-
return accessor?.openConfiguration(options);
|
315
|
-
}
|
316
|
-
async function listRecords(request) {
|
317
|
-
return accessor?.listRecords(request);
|
318
|
-
}
|
319
|
-
async function findRecords(request) {
|
320
|
-
return accessor?.findRecords(request);
|
321
|
-
}
|
322
|
-
async function findRecordById(id) {
|
323
|
-
return accessor?.findRecordById(id);
|
324
|
-
}
|
325
|
-
async function createRecord(request) {
|
326
|
-
return accessor?.createRecord(request);
|
327
|
-
}
|
328
|
-
async function updateRecord(request) {
|
329
|
-
return accessor?.updateRecord(request);
|
330
|
-
}
|
331
|
-
async function deleteRecord(id) {
|
332
|
-
return accessor?.deleteRecord(id);
|
333
|
-
}
|
334
|
-
async function unifiedFieldsToNative(unifiedFields) {
|
335
|
-
return accessor?.unifiedFieldsToNative(unifiedFields);
|
336
|
-
}
|
337
|
-
async function getCollection() {
|
338
|
-
return accessor?.getCollection();
|
339
|
-
}
|
340
|
-
return {
|
341
|
-
dataSourceInstance,
|
342
|
-
accessor,
|
343
|
-
refresh,
|
344
|
-
setup,
|
345
|
-
reset,
|
346
|
-
openConfiguration,
|
347
|
-
listRecords,
|
348
|
-
findRecords,
|
349
|
-
findRecordById,
|
350
|
-
createRecord,
|
351
|
-
updateRecord,
|
352
|
-
deleteRecord,
|
353
|
-
unifiedFieldsToNative,
|
354
|
-
getCollection,
|
355
|
-
...rest,
|
356
|
-
};
|
357
|
-
}
|
358
|
-
|
359
|
-
function useDataSourceInstanceCollection(dataSourceInstance) {
|
360
|
-
const integrationApp = useIntegrationApp();
|
361
|
-
const { data, error, isLoading, mutate } = useSWR(dataSourceInstance ? `${dataSourceInstance.id}/collection` : null, () => integrationApp.dataSourceInstance(dataSourceInstance.id).getCollection());
|
362
|
-
async function refresh() {
|
363
|
-
return await mutate();
|
364
|
-
}
|
365
|
-
const collection = data;
|
366
|
-
return {
|
367
|
-
collection,
|
368
|
-
refresh,
|
369
|
-
error,
|
370
|
-
loading: isLoading,
|
371
|
-
};
|
372
|
-
}
|
373
|
-
|
374
|
-
function useDataSourceInstances(query) {
|
375
|
-
const { ...rest } = useElements('data-source-instances', query);
|
376
|
-
return {
|
377
|
-
dataSourceInstances: rest.items,
|
378
|
-
...rest,
|
379
|
-
};
|
380
|
-
}
|
381
|
-
|
382
|
-
function useDataSources(query) {
|
383
|
-
const { ...rest } = useElements('data-sources', query);
|
384
|
-
return {
|
385
|
-
dataSources: rest.items,
|
386
|
-
...rest,
|
387
|
-
};
|
388
|
-
}
|
389
|
-
|
390
|
-
function useAppEventSubscription(selector) {
|
391
|
-
const { item: appEventSubscription, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.appEventSubscription(selector) : undefined);
|
392
|
-
return { appEventSubscription, ...rest };
|
393
|
-
}
|
394
|
-
|
395
|
-
function useAppEventSubscriptions(query) {
|
396
|
-
const { ...rest } = useElements('app-event-subscriptions', query);
|
397
|
-
return {
|
398
|
-
appEventSubscriptions: rest.items,
|
399
|
-
...rest,
|
400
|
-
};
|
401
|
-
}
|
402
|
-
|
403
|
-
function useAppEventType(selector) {
|
404
|
-
const { item: appEventType, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.appEventType(selector) : undefined);
|
405
|
-
return { appEventType, ...rest };
|
406
|
-
}
|
407
|
-
|
408
|
-
function useAppEventTypes(query) {
|
409
|
-
const { ...rest } = useElements('app-event-types', query);
|
410
|
-
return {
|
411
|
-
appEventTypes: rest.items,
|
412
|
-
...rest,
|
413
|
-
};
|
414
|
-
}
|
415
|
-
|
416
|
-
function useAppEvents(query) {
|
417
|
-
const { ...rest } = useElements('app-events', query);
|
418
|
-
return {
|
419
|
-
appEvents: rest.items,
|
420
|
-
...rest,
|
421
|
-
};
|
422
|
-
}
|
423
|
-
|
424
|
-
function useAppDataSchema(selector) {
|
425
|
-
const { item: appDataSchema, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.appDataSchema(selector) : undefined);
|
426
|
-
return { appDataSchema, ...rest };
|
427
|
-
}
|
428
|
-
|
429
|
-
function useAppDataSchemas(query) {
|
430
|
-
const { ...rest } = useElements('app-data-schemas', query);
|
431
|
-
return {
|
432
|
-
appDataSchemas: rest.items,
|
433
|
-
...rest,
|
434
|
-
};
|
435
|
-
}
|
436
|
-
|
437
|
-
function useAppDataSchemaInstance(selector) {
|
438
|
-
const { item: appDataSchemaInstance, accessor, refresh, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.appDataSchemaInstance(selector) : undefined);
|
439
|
-
async function setup() {
|
440
|
-
await accessor?.setup();
|
441
|
-
await refresh();
|
442
|
-
}
|
443
|
-
return {
|
444
|
-
appDataSchemaInstance,
|
445
|
-
accessor,
|
446
|
-
refresh,
|
447
|
-
setup,
|
448
|
-
...rest,
|
449
|
-
};
|
450
|
-
}
|
451
|
-
|
452
|
-
function useAppDataSchemaInstances(query) {
|
453
|
-
const { ...rest } = useElements('app-data-schema-instances', query);
|
454
|
-
return {
|
455
|
-
appDataSchemaInstances: rest.items,
|
456
|
-
...rest,
|
457
|
-
};
|
458
|
-
}
|
459
|
-
|
460
|
-
function useFlow(selector) {
|
461
|
-
const { item: flow, accessor, refresh, ...rest } = useElement(selector, (integrationApp) => (selector ? integrationApp.flow(selector) : undefined));
|
462
|
-
async function apply(integrationKeys) {
|
463
|
-
const result = await accessor?.apply(integrationKeys);
|
464
|
-
await refresh();
|
465
|
-
return result;
|
466
|
-
}
|
467
|
-
async function reset() {
|
468
|
-
await accessor?.reset();
|
469
|
-
return await refresh();
|
470
|
-
}
|
471
|
-
return { flow, apply, reset, refresh, accessor, ...rest };
|
472
|
-
}
|
473
|
-
|
474
|
-
function useFlows(query) {
|
475
|
-
const { ...rest } = useElements('flows', query);
|
476
|
-
return {
|
477
|
-
flows: rest.items,
|
478
|
-
...rest,
|
479
|
-
};
|
480
|
-
}
|
481
|
-
|
482
|
-
function useFlowInstance(selector) {
|
483
|
-
const { item: flowInstance, accessor, refresh, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.flowInstance(selector) : undefined);
|
484
|
-
async function enable() {
|
485
|
-
await accessor?.enable();
|
486
|
-
await refresh();
|
487
|
-
}
|
488
|
-
async function disable() {
|
489
|
-
await accessor?.disable();
|
490
|
-
await refresh();
|
491
|
-
}
|
492
|
-
async function reset(options) {
|
493
|
-
await accessor?.reset(options);
|
494
|
-
await refresh();
|
495
|
-
}
|
496
|
-
async function setup() {
|
497
|
-
await accessor?.setup();
|
498
|
-
await refresh();
|
499
|
-
}
|
500
|
-
async function openConfiguration(options) {
|
501
|
-
return accessor?.openConfiguration(options);
|
502
|
-
}
|
503
|
-
async function run(options = {}) {
|
504
|
-
return accessor?.run(options);
|
505
|
-
}
|
506
|
-
async function startRun(options = {}) {
|
507
|
-
return accessor?.startRun(options);
|
508
|
-
}
|
509
|
-
return {
|
510
|
-
flowInstance,
|
511
|
-
accessor,
|
512
|
-
refresh,
|
513
|
-
enable,
|
514
|
-
disable,
|
515
|
-
reset,
|
516
|
-
setup,
|
517
|
-
openConfiguration,
|
518
|
-
run,
|
519
|
-
startRun,
|
520
|
-
...rest,
|
521
|
-
};
|
522
|
-
}
|
523
|
-
|
524
|
-
function useFlowInstances(query) {
|
525
|
-
const { ...rest } = useElements('flow-instances', query);
|
526
|
-
return {
|
527
|
-
flowInstances: rest.items,
|
528
|
-
...rest,
|
529
|
-
};
|
530
|
-
}
|
531
|
-
|
532
|
-
function useFlowRun(id) {
|
533
|
-
const { item: flowRun, archive, refresh, error, loading, } = useElement(id, (integrationApp) => id ? integrationApp.flowRun(id) : undefined);
|
534
|
-
return {
|
535
|
-
flowRun,
|
536
|
-
error,
|
537
|
-
loading,
|
538
|
-
refresh,
|
539
|
-
archive,
|
540
|
-
};
|
541
|
-
}
|
542
|
-
|
543
|
-
function useFlowRuns(query) {
|
544
|
-
const { ...rest } = useElements('flow-runs', query);
|
545
|
-
return {
|
546
|
-
flowRuns: rest.items,
|
547
|
-
...rest,
|
548
|
-
};
|
549
|
-
}
|
550
|
-
|
551
|
-
function useDataLinkTable(selector) {
|
552
|
-
const { item: dataLinkTable, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.dataLinkTable(selector) : undefined);
|
553
|
-
return { dataLinkTable, ...rest };
|
554
|
-
}
|
555
|
-
|
556
|
-
function useDataLinkTableInstance(selector) {
|
557
|
-
const { item: dataLinkTableInstance, accessor, refresh, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.dataLinkTableInstance(selector) : undefined);
|
558
|
-
return {
|
559
|
-
dataLinkTableInstance,
|
560
|
-
accessor,
|
561
|
-
refresh,
|
562
|
-
findLinks: accessor?.findLinks,
|
563
|
-
createLink: accessor?.createLink,
|
564
|
-
deleteLink: accessor?.deleteLink,
|
565
|
-
...rest,
|
566
|
-
};
|
567
|
-
}
|
568
|
-
|
569
|
-
function useDataLinkTableInstances(query) {
|
570
|
-
const { ...rest } = useElements('data-link-table-instances', query);
|
571
|
-
return {
|
572
|
-
dataLinkTableInstances: rest.items,
|
573
|
-
...rest,
|
574
|
-
};
|
575
|
-
}
|
576
|
-
|
577
|
-
function useDataLinkTables(query) {
|
578
|
-
const { ...rest } = useElements('data-link-tables', query);
|
579
|
-
return {
|
580
|
-
dataLinkTables: rest.items,
|
581
|
-
...rest,
|
582
|
-
};
|
583
|
-
}
|
584
|
-
|
585
|
-
function useAction(selector) {
|
586
|
-
const { item: action, accessor, refresh, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.action(selector) : undefined);
|
587
|
-
async function apply(integrationKeys) {
|
588
|
-
const result = await accessor?.apply(integrationKeys);
|
589
|
-
await refresh();
|
590
|
-
return result;
|
591
|
-
}
|
592
|
-
async function reset() {
|
593
|
-
await accessor?.reset();
|
594
|
-
await refresh();
|
595
|
-
}
|
596
|
-
return { action, apply, reset, refresh, accessor, ...rest };
|
597
|
-
}
|
598
|
-
|
599
|
-
function useActionInstance(selector) {
|
600
|
-
const { item: actionInstance, accessor, refresh, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.actionInstance(selector) : undefined);
|
601
|
-
async function run(input) {
|
602
|
-
return accessor?.run(input);
|
603
|
-
}
|
604
|
-
async function setup() {
|
605
|
-
await accessor?.setup();
|
606
|
-
await refresh();
|
607
|
-
}
|
608
|
-
async function reset() {
|
609
|
-
await accessor?.reset();
|
610
|
-
await refresh();
|
611
|
-
}
|
612
|
-
async function openConfiguration(options) {
|
613
|
-
return accessor?.open(options);
|
614
|
-
}
|
615
|
-
return {
|
616
|
-
actionInstance,
|
617
|
-
accessor,
|
618
|
-
refresh,
|
619
|
-
setup,
|
620
|
-
reset,
|
621
|
-
openConfiguration,
|
622
|
-
run,
|
623
|
-
...rest,
|
624
|
-
};
|
625
|
-
}
|
626
|
-
|
627
|
-
function useActionInstances(query) {
|
628
|
-
const { ...rest } = useElements('action-instances', query);
|
629
|
-
return {
|
630
|
-
actionInstances: rest.items,
|
631
|
-
...rest,
|
632
|
-
};
|
633
|
-
}
|
634
|
-
|
635
|
-
function useActions(query) {
|
636
|
-
const { ...rest } = useElements('actions', query);
|
637
|
-
return {
|
638
|
-
actions: rest.items,
|
639
|
-
...rest,
|
640
|
-
};
|
641
|
-
}
|
642
|
-
|
643
|
-
function useScreen(selector) {
|
644
|
-
const { item: screen, ...rest } = useElement(selector, (integrationApp) => integrationApp.screen(selector));
|
645
|
-
return { screen, ...rest };
|
646
|
-
}
|
647
|
-
|
648
|
-
function useCustomer(selector) {
|
649
|
-
const { item: customer, ...rest } = useElement(selector, (c) => (selector ? c.customer(selector) : undefined));
|
650
|
-
return { customer, ...rest };
|
651
|
-
}
|
652
|
-
|
653
|
-
function useCustomers(query) {
|
654
|
-
const { ...rest } = useElements('customers', query);
|
655
|
-
return {
|
656
|
-
customers: rest.items,
|
657
|
-
...rest,
|
658
|
-
};
|
659
|
-
}
|
660
|
-
|
661
|
-
function useScenario(selector) {
|
662
|
-
const { item: scenario, ...rest } = useElement(selector, (integrationApp) => selector ? integrationApp.scenario(selector) : undefined);
|
663
|
-
return { scenario, ...rest };
|
664
|
-
}
|
665
|
-
|
666
|
-
function useScenarios(query) {
|
667
|
-
const { ...rest } = useElements('scenarios', query);
|
668
|
-
return {
|
669
|
-
scenarios: rest.items,
|
670
|
-
...rest,
|
671
|
-
};
|
672
|
-
}
|
673
|
-
|
674
|
-
function useDataCollectionSpec({ path, key, integrationId, }) {
|
675
|
-
const client = useIntegrationApp();
|
676
|
-
const dataCollectionKey = key ?? parseDataLocationPath(path)?.key;
|
677
|
-
const { data: dataCollectionSpec } = useSWR(dataCollectionKey && integrationId
|
678
|
-
? `/integrations/${integrationId}/data/${dataCollectionKey}`
|
679
|
-
: null, async () => {
|
680
|
-
return client
|
681
|
-
.integration(integrationId)
|
682
|
-
.getDataCollection(dataCollectionKey);
|
683
|
-
});
|
684
|
-
return dataCollectionSpec;
|
685
|
-
}
|
686
|
-
|
687
|
-
function useExternalEventSubscriptions(query) {
|
688
|
-
const { ...rest } = useElements('external-event-subscriptions', query);
|
689
|
-
return {
|
690
|
-
externalEventSubscriptions: rest.items,
|
691
|
-
...rest,
|
692
|
-
};
|
693
|
-
}
|
694
|
-
|
695
|
-
function useExternalEventSubscription(id) {
|
696
|
-
const { item: externalEventSubscription, accessor, refresh, ...rest } = useElement(id, (integrationApp) => id ? integrationApp.externalEventSubscription(id) : undefined);
|
697
|
-
async function setup() {
|
698
|
-
await accessor?.setup();
|
699
|
-
await refresh();
|
700
|
-
}
|
701
|
-
async function subscribe() {
|
702
|
-
await accessor?.subscribe();
|
703
|
-
await refresh();
|
704
|
-
}
|
705
|
-
async function resubscribe() {
|
706
|
-
await accessor?.resubscribe();
|
707
|
-
await refresh();
|
708
|
-
}
|
709
|
-
async function unsubscribe() {
|
710
|
-
await accessor?.unsubscribe();
|
711
|
-
await refresh();
|
712
|
-
}
|
713
|
-
async function pullEvents() {
|
714
|
-
await accessor?.pullEvents();
|
715
|
-
await refresh();
|
716
|
-
}
|
717
|
-
return {
|
718
|
-
externalEventSubscription,
|
719
|
-
accessor,
|
720
|
-
refresh,
|
721
|
-
setup,
|
722
|
-
subscribe,
|
723
|
-
resubscribe,
|
724
|
-
unsubscribe,
|
725
|
-
pullEvents,
|
726
|
-
...rest,
|
727
|
-
};
|
728
|
-
}
|
729
|
-
|
730
|
-
function useIntegrationElement(accessor) {
|
731
|
-
if (!accessor.getUniqueIdentifier) {
|
732
|
-
throw new Error('This accessor can not be used for with `useIntegrationElement` hook. Method `getUniqueIdentifier` is missing.');
|
733
|
-
}
|
734
|
-
return useElement(accessor.getUniqueIdentifier(), () => accessor);
|
735
|
-
}
|
736
|
-
|
737
|
-
// src/assert.ts
|
738
|
-
function isObject(value) {
|
739
|
-
return typeof value === "object" && value != null && !Array.isArray(value);
|
740
|
-
}
|
741
|
-
|
742
|
-
// src/compact.ts
|
743
|
-
function compact(value) {
|
744
|
-
return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));
|
745
|
-
}
|
746
|
-
|
747
|
-
// src/condition.ts
|
748
|
-
var isBaseCondition = (v) => v === "base";
|
749
|
-
function filterBaseConditions(c) {
|
750
|
-
return c.slice().filter((v) => !isBaseCondition(v));
|
751
|
-
}
|
752
|
-
|
753
|
-
// src/hash.ts
|
754
|
-
function toChar(code) {
|
755
|
-
return String.fromCharCode(code + (code > 25 ? 39 : 97));
|
756
|
-
}
|
757
|
-
function toName(code) {
|
758
|
-
let name = "";
|
759
|
-
let x;
|
760
|
-
for (x = Math.abs(code); x > 52; x = x / 52 | 0)
|
761
|
-
name = toChar(x % 52) + name;
|
762
|
-
return toChar(x % 52) + name;
|
763
|
-
}
|
764
|
-
function toPhash(h, x) {
|
765
|
-
let i = x.length;
|
766
|
-
while (i)
|
767
|
-
h = h * 33 ^ x.charCodeAt(--i);
|
768
|
-
return h;
|
769
|
-
}
|
770
|
-
function toHash(value) {
|
771
|
-
return toName(toPhash(5381, value) >>> 0);
|
772
|
-
}
|
773
|
-
|
774
|
-
// src/important.ts
|
775
|
-
var importantRegex = /\s*!(important)?/i;
|
776
|
-
function isImportant(value) {
|
777
|
-
return typeof value === "string" ? importantRegex.test(value) : false;
|
778
|
-
}
|
779
|
-
function withoutImportant(value) {
|
780
|
-
return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
|
781
|
-
}
|
782
|
-
function withoutSpace(str) {
|
783
|
-
return typeof str === "string" ? str.replaceAll(" ", "_") : str;
|
784
|
-
}
|
785
|
-
|
786
|
-
// src/memo.ts
|
787
|
-
var memo = (fn) => {
|
788
|
-
const cache = /* @__PURE__ */ new Map();
|
789
|
-
const get = (...args) => {
|
790
|
-
const key = JSON.stringify(args);
|
791
|
-
if (cache.has(key)) {
|
792
|
-
return cache.get(key);
|
793
|
-
}
|
794
|
-
const result = fn(...args);
|
795
|
-
cache.set(key, result);
|
796
|
-
return result;
|
797
|
-
};
|
798
|
-
return get;
|
799
|
-
};
|
800
|
-
|
801
|
-
// src/merge-props.ts
|
802
|
-
function mergeProps(...sources) {
|
803
|
-
const objects = sources.filter(Boolean);
|
804
|
-
return objects.reduce((prev, obj) => {
|
805
|
-
Object.keys(obj).forEach((key) => {
|
806
|
-
const prevValue = prev[key];
|
807
|
-
const value = obj[key];
|
808
|
-
if (isObject(prevValue) && isObject(value)) {
|
809
|
-
prev[key] = mergeProps(prevValue, value);
|
810
|
-
} else {
|
811
|
-
prev[key] = value;
|
812
|
-
}
|
813
|
-
});
|
814
|
-
return prev;
|
815
|
-
}, {});
|
816
|
-
}
|
817
|
-
|
818
|
-
// src/walk-object.ts
|
819
|
-
var isNotNullish = (element) => element != null;
|
820
|
-
function walkObject(target, predicate, options = {}) {
|
821
|
-
const { stop, getKey } = options;
|
822
|
-
function inner(value, path = []) {
|
823
|
-
if (isObject(value) || Array.isArray(value)) {
|
824
|
-
const result = {};
|
825
|
-
for (const [prop, child] of Object.entries(value)) {
|
826
|
-
const key = getKey?.(prop, child) ?? prop;
|
827
|
-
const childPath = [...path, key];
|
828
|
-
if (stop?.(value, childPath)) {
|
829
|
-
return predicate(value, path);
|
830
|
-
}
|
831
|
-
const next = inner(child, childPath);
|
832
|
-
if (isNotNullish(next)) {
|
833
|
-
result[key] = next;
|
834
|
-
}
|
835
|
-
}
|
836
|
-
return result;
|
837
|
-
}
|
838
|
-
return predicate(value, path);
|
839
|
-
}
|
840
|
-
return inner(target);
|
841
|
-
}
|
842
|
-
function mapObject(obj, fn) {
|
843
|
-
if (Array.isArray(obj))
|
844
|
-
return obj.map((value) => fn(value));
|
845
|
-
if (!isObject(obj))
|
846
|
-
return fn(obj);
|
847
|
-
return walkObject(obj, (value) => fn(value));
|
848
|
-
}
|
849
|
-
|
850
|
-
// src/normalize-style-object.ts
|
851
|
-
function toResponsiveObject(values, breakpoints) {
|
852
|
-
return values.reduce(
|
853
|
-
(acc, current, index) => {
|
854
|
-
const key = breakpoints[index];
|
855
|
-
if (current != null) {
|
856
|
-
acc[key] = current;
|
857
|
-
}
|
858
|
-
return acc;
|
859
|
-
},
|
860
|
-
{}
|
861
|
-
);
|
862
|
-
}
|
863
|
-
function normalizeStyleObject(styles, context, shorthand = true) {
|
864
|
-
const { utility, conditions } = context;
|
865
|
-
const { hasShorthand, resolveShorthand } = utility;
|
866
|
-
return walkObject(
|
867
|
-
styles,
|
868
|
-
(value) => {
|
869
|
-
return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;
|
870
|
-
},
|
871
|
-
{
|
872
|
-
stop: (value) => Array.isArray(value),
|
873
|
-
getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
|
874
|
-
}
|
875
|
-
);
|
876
|
-
}
|
877
|
-
|
878
|
-
// src/classname.ts
|
879
|
-
var fallbackCondition = {
|
880
|
-
shift: (v) => v,
|
881
|
-
finalize: (v) => v,
|
882
|
-
breakpoints: { keys: [] }
|
883
|
-
};
|
884
|
-
var sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\n\s]+/g, " ") : value;
|
885
|
-
function createCss(context) {
|
886
|
-
const { utility, hash, conditions: conds = fallbackCondition } = context;
|
887
|
-
const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");
|
888
|
-
const hashFn = (conditions, className) => {
|
889
|
-
let result;
|
890
|
-
if (hash) {
|
891
|
-
const baseArray = [...conds.finalize(conditions), className];
|
892
|
-
result = formatClassName(utility.toHash(baseArray, toHash));
|
893
|
-
} else {
|
894
|
-
const baseArray = [...conds.finalize(conditions), formatClassName(className)];
|
895
|
-
result = baseArray.join(":");
|
896
|
-
}
|
897
|
-
return result;
|
898
|
-
};
|
899
|
-
return memo(({ base, ...styles } = {}) => {
|
900
|
-
const styleObject = Object.assign(styles, base);
|
901
|
-
const normalizedObject = normalizeStyleObject(styleObject, context);
|
902
|
-
const classNames = /* @__PURE__ */ new Set();
|
903
|
-
walkObject(normalizedObject, (value, paths) => {
|
904
|
-
const important = isImportant(value);
|
905
|
-
if (value == null)
|
906
|
-
return;
|
907
|
-
const [prop, ...allConditions] = conds.shift(paths);
|
908
|
-
const conditions = filterBaseConditions(allConditions);
|
909
|
-
const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
|
910
|
-
let className = hashFn(conditions, transformed.className);
|
911
|
-
if (important)
|
912
|
-
className = `${className}!`;
|
913
|
-
classNames.add(className);
|
914
|
-
});
|
915
|
-
return Array.from(classNames).join(" ");
|
916
|
-
});
|
917
|
-
}
|
918
|
-
function compactStyles(...styles) {
|
919
|
-
return styles.flat().filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);
|
920
|
-
}
|
921
|
-
function createMergeCss(context) {
|
922
|
-
function resolve(styles) {
|
923
|
-
const allStyles = compactStyles(...styles);
|
924
|
-
if (allStyles.length === 1)
|
925
|
-
return allStyles;
|
926
|
-
return allStyles.map((style) => normalizeStyleObject(style, context));
|
927
|
-
}
|
928
|
-
function mergeCss(...styles) {
|
929
|
-
return mergeProps(...resolve(styles));
|
930
|
-
}
|
931
|
-
function assignCss(...styles) {
|
932
|
-
return Object.assign({}, ...resolve(styles));
|
933
|
-
}
|
934
|
-
return { mergeCss: memo(mergeCss), assignCss };
|
935
|
-
}
|
936
|
-
|
937
|
-
// src/hypenate-property.ts
|
938
|
-
var wordRegex = /([A-Z])/g;
|
939
|
-
var msRegex = /^ms-/;
|
940
|
-
var hypenateProperty = memo((property) => {
|
941
|
-
if (property.startsWith("--"))
|
942
|
-
return property;
|
943
|
-
return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
|
944
|
-
});
|
945
|
-
|
946
|
-
// src/is-css-function.ts
|
947
|
-
var fns = ["min", "max", "clamp", "calc"];
|
948
|
-
var fnRegExp = new RegExp(`^(${fns.join("|")})\\(.*\\)`);
|
949
|
-
var isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);
|
950
|
-
|
951
|
-
// src/is-css-unit.ts
|
952
|
-
var lengthUnits = "cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%";
|
953
|
-
var lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;
|
954
|
-
var lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);
|
955
|
-
var isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);
|
956
|
-
|
957
|
-
// src/is-css-var.ts
|
958
|
-
var isCssVar = (v) => typeof v === "string" && /^var\(--.+\)$/.test(v);
|
959
|
-
|
960
|
-
// src/pattern-fns.ts
|
961
|
-
var patternFns = {
|
962
|
-
map: mapObject,
|
963
|
-
isCssFunction,
|
964
|
-
isCssVar,
|
965
|
-
isCssUnit
|
966
|
-
};
|
967
|
-
var getPatternStyles = (pattern, styles) => {
|
968
|
-
if (!pattern?.defaultValues)
|
969
|
-
return styles;
|
970
|
-
const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;
|
971
|
-
return Object.assign({}, defaults, compact(styles));
|
972
|
-
};
|
973
|
-
|
974
|
-
// src/split-props.ts
|
975
|
-
function splitProps(props, ...keys) {
|
976
|
-
const descriptors = Object.getOwnPropertyDescriptors(props);
|
977
|
-
const dKeys = Object.keys(descriptors);
|
978
|
-
const split = (k) => {
|
979
|
-
const clone = {};
|
980
|
-
for (let i = 0; i < k.length; i++) {
|
981
|
-
const key = k[i];
|
982
|
-
if (descriptors[key]) {
|
983
|
-
Object.defineProperty(clone, key, descriptors[key]);
|
984
|
-
delete descriptors[key];
|
985
|
-
}
|
986
|
-
}
|
987
|
-
return clone;
|
988
|
-
};
|
989
|
-
const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
|
990
|
-
return keys.map(fn).concat(split(dKeys));
|
991
|
-
}
|
992
|
-
|
993
|
-
// src/uniq.ts
|
994
|
-
var uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(/* @__PURE__ */ new Set([...acc, ...item])), []);
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
// src/normalize-html.ts
|
999
|
-
var htmlProps = ["htmlSize", "htmlTranslate", "htmlWidth", "htmlHeight"];
|
1000
|
-
function convert(key) {
|
1001
|
-
return htmlProps.includes(key) ? key.replace("html", "").toLowerCase() : key;
|
1002
|
-
}
|
1003
|
-
function normalizeHTMLProps(props) {
|
1004
|
-
return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
|
1005
|
-
}
|
1006
|
-
normalizeHTMLProps.keys = htmlProps;
|
1007
|
-
|
1008
|
-
const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_starting,_collapsed,_current,_hidden,_off,_on,_today,_underValue,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,base";
|
1009
|
-
const conditions = new Set(conditionsStr.split(','));
|
1010
|
-
|
1011
|
-
function isCondition(value){
|
1012
|
-
return conditions.has(value) || /^@|&|&$/.test(value)
|
1013
|
-
}
|
1014
|
-
|
1015
|
-
const underscoreRegex = /^_/;
|
1016
|
-
const conditionsSelectorRegex = /&|@/;
|
1017
|
-
|
1018
|
-
function finalizeConditions(paths){
|
1019
|
-
return paths.map((path) => {
|
1020
|
-
if (conditions.has(path)){
|
1021
|
-
return path.replace(underscoreRegex, '')
|
1022
|
-
}
|
1023
|
-
|
1024
|
-
if (conditionsSelectorRegex.test(path)){
|
1025
|
-
return `[${withoutSpace(path.trim())}]`
|
1026
|
-
}
|
1027
|
-
|
1028
|
-
return path
|
1029
|
-
})}
|
1030
|
-
|
1031
|
-
function sortConditions(paths){
|
1032
|
-
return paths.sort((a, b) => {
|
1033
|
-
const aa = isCondition(a);
|
1034
|
-
const bb = isCondition(b);
|
1035
|
-
if (aa && !bb) return 1
|
1036
|
-
if (!aa && bb) return -1
|
1037
|
-
return 0
|
1038
|
-
})
|
1039
|
-
}
|
1040
|
-
|
1041
|
-
const utilities = "aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,textStyle:textStyle";
|
1042
|
-
|
1043
|
-
const classNameByProp = new Map();
|
1044
|
-
const shorthands = new Map();
|
1045
|
-
utilities.split(',').forEach((utility) => {
|
1046
|
-
const [prop, meta] = utility.split(':');
|
1047
|
-
const [className, ...shorthandList] = meta.split('/');
|
1048
|
-
classNameByProp.set(prop, className);
|
1049
|
-
if (shorthandList.length) {
|
1050
|
-
shorthandList.forEach((shorthand) => {
|
1051
|
-
shorthands.set(shorthand === '1' ? className : shorthand, prop);
|
1052
|
-
});
|
1053
|
-
}
|
1054
|
-
});
|
1055
|
-
|
1056
|
-
const resolveShorthand = (prop) => shorthands.get(prop) || prop;
|
1057
|
-
|
1058
|
-
const context = {
|
1059
|
-
|
1060
|
-
conditions: {
|
1061
|
-
shift: sortConditions,
|
1062
|
-
finalize: finalizeConditions,
|
1063
|
-
breakpoints: { keys: ["base","sm","md","lg","xl","2xl"] }
|
1064
|
-
},
|
1065
|
-
utility: {
|
1066
|
-
|
1067
|
-
transform: (prop, value) => {
|
1068
|
-
const key = resolveShorthand(prop);
|
1069
|
-
const propKey = classNameByProp.get(key) || hypenateProperty(key);
|
1070
|
-
return { className: `${propKey}_${withoutSpace(value)}` }
|
1071
|
-
},
|
1072
|
-
hasShorthand: true,
|
1073
|
-
toHash: (path, hashFn) => hashFn(path.join(":")),
|
1074
|
-
resolveShorthand: resolveShorthand,
|
1075
|
-
}
|
1076
|
-
};
|
1077
|
-
|
1078
|
-
const cssFn = createCss(context);
|
1079
|
-
const css = (...styles) => cssFn(mergeCss(...styles));
|
1080
|
-
css.raw = (...styles) => mergeCss(...styles);
|
1081
|
-
|
1082
|
-
const { mergeCss, assignCss } = createMergeCss(context);
|
1083
|
-
|
1084
|
-
function cx() {
|
1085
|
-
let str = '',
|
1086
|
-
i = 0,
|
1087
|
-
arg;
|
1088
|
-
|
1089
|
-
for (; i < arguments.length; ) {
|
1090
|
-
if ((arg = arguments[i++]) && typeof arg === 'string') {
|
1091
|
-
str && (str += ' ');
|
1092
|
-
str += arg;
|
1093
|
-
}
|
1094
|
-
}
|
1095
|
-
return str
|
1096
|
-
}
|
1097
|
-
|
1098
|
-
const defaults = (conf) => ({
|
1099
|
-
base: {},
|
1100
|
-
variants: {},
|
1101
|
-
defaultVariants: {},
|
1102
|
-
compoundVariants: [],
|
1103
|
-
...conf,
|
1104
|
-
});
|
1105
|
-
|
1106
|
-
function cva(config) {
|
1107
|
-
const { base, variants, defaultVariants, compoundVariants } = defaults(config);
|
1108
|
-
const getVariantProps = (variants) => ({ ...defaultVariants, ...compact(variants) });
|
1109
|
-
|
1110
|
-
function resolve(props = {}) {
|
1111
|
-
const computedVariants = getVariantProps(props);
|
1112
|
-
let variantCss = { ...base };
|
1113
|
-
for (const [key, value] of Object.entries(computedVariants)) {
|
1114
|
-
if (variants[key]?.[value]) {
|
1115
|
-
variantCss = mergeCss(variantCss, variants[key][value]);
|
1116
|
-
}
|
1117
|
-
}
|
1118
|
-
const compoundVariantCss = getCompoundVariantCss(compoundVariants, computedVariants);
|
1119
|
-
return mergeCss(variantCss, compoundVariantCss)
|
1120
|
-
}
|
1121
|
-
|
1122
|
-
function merge(__cva) {
|
1123
|
-
const override = defaults(__cva.config);
|
1124
|
-
const variantKeys = uniq(__cva.variantKeys, Object.keys(variants));
|
1125
|
-
return cva({
|
1126
|
-
base: mergeCss(base, override.base),
|
1127
|
-
variants: Object.fromEntries(
|
1128
|
-
variantKeys.map((key) => [key, mergeCss(variants[key], override.variants[key])]),
|
1129
|
-
),
|
1130
|
-
defaultVariants: mergeProps(defaultVariants, override.defaultVariants),
|
1131
|
-
compoundVariants: [...compoundVariants, ...override.compoundVariants],
|
1132
|
-
})
|
1133
|
-
}
|
1134
|
-
|
1135
|
-
function cvaFn(props) {
|
1136
|
-
return css(resolve(props))
|
1137
|
-
}
|
1138
|
-
|
1139
|
-
const variantKeys = Object.keys(variants);
|
1140
|
-
|
1141
|
-
function splitVariantProps(props) {
|
1142
|
-
return splitProps(props, variantKeys)
|
1143
|
-
}
|
1144
|
-
|
1145
|
-
const variantMap = Object.fromEntries(Object.entries(variants).map(([key, value]) => [key, Object.keys(value)]));
|
1146
|
-
|
1147
|
-
return Object.assign(memo(cvaFn), {
|
1148
|
-
__cva__: true,
|
1149
|
-
variantMap,
|
1150
|
-
variantKeys,
|
1151
|
-
raw: resolve,
|
1152
|
-
config,
|
1153
|
-
merge,
|
1154
|
-
splitVariantProps,
|
1155
|
-
getVariantProps
|
1156
|
-
})
|
1157
|
-
}
|
1158
|
-
|
1159
|
-
function getCompoundVariantCss(compoundVariants, variantMap) {
|
1160
|
-
let result = {};
|
1161
|
-
compoundVariants.forEach((compoundVariant) => {
|
1162
|
-
const isMatching = Object.entries(compoundVariant).every(([key, value]) => {
|
1163
|
-
if (key === 'css') return true
|
1164
|
-
|
1165
|
-
const values = Array.isArray(value) ? value : [value];
|
1166
|
-
return values.some((value) => variantMap[key] === value)
|
1167
|
-
});
|
1168
|
-
|
1169
|
-
if (isMatching) {
|
1170
|
-
result = mergeCss(result, compoundVariant.css);
|
1171
|
-
}
|
1172
|
-
});
|
1173
|
-
|
1174
|
-
return result
|
1175
|
-
}
|
1176
|
-
|
1177
|
-
function assertCompoundVariant(name, compoundVariants, variants, prop) {
|
1178
|
-
if (compoundVariants.length > 0 && typeof variants?.[prop] === 'object') {
|
1179
|
-
throw new Error(`[recipe:${name}:${prop}] Conditions are not supported when using compound variants.`)
|
1180
|
-
}
|
1181
|
-
}
|
1182
|
-
|
1183
|
-
// src/index.ts
|
1184
|
-
var userGeneratedStr = "css,pos,insetX,insetY,insetEnd,end,insetStart,start,flexDir,p,pl,pr,pt,pb,py,paddingY,paddingX,px,pe,paddingEnd,ps,paddingStart,ml,mr,mt,mb,m,my,marginY,mx,marginX,me,marginEnd,ms,marginStart,ringWidth,ringColor,ring,ringOffset,w,minW,maxW,h,minH,maxH,textShadowColor,bgPosition,bgPositionX,bgPositionY,bgAttachment,bgClip,bg,bgColor,bgOrigin,bgImage,bgRepeat,bgBlendMode,bgSize,bgGradient,rounded,roundedTopLeft,roundedTopRight,roundedBottomRight,roundedBottomLeft,roundedTop,roundedRight,roundedBottom,roundedLeft,roundedStartStart,roundedStartEnd,roundedStart,roundedEndStart,roundedEndEnd,roundedEnd,borderX,borderXWidth,borderXColor,borderY,borderYWidth,borderYColor,borderStart,borderStartWidth,borderStartColor,borderEnd,borderEndWidth,borderEndColor,shadow,shadowColor,x,y,z,scrollMarginY,scrollMarginX,scrollPaddingY,scrollPaddingX,aspectRatio,boxDecorationBreak,zIndex,boxSizing,objectPosition,objectFit,overscrollBehavior,overscrollBehaviorX,overscrollBehaviorY,position,top,left,inset,insetInline,insetBlock,insetBlockEnd,insetBlockStart,insetInlineEnd,insetInlineStart,right,bottom,float,visibility,display,hideFrom,hideBelow,flexBasis,flex,flexDirection,flexGrow,flexShrink,gridTemplateColumns,gridTemplateRows,gridColumn,gridRow,gridColumnStart,gridColumnEnd,gridAutoFlow,gridAutoColumns,gridAutoRows,gap,gridGap,gridRowGap,gridColumnGap,rowGap,columnGap,justifyContent,alignContent,alignItems,alignSelf,padding,paddingLeft,paddingRight,paddingTop,paddingBottom,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingInline,paddingInlineEnd,paddingInlineStart,marginLeft,marginRight,marginTop,marginBottom,margin,marginBlock,marginBlockEnd,marginBlockStart,marginInline,marginInlineEnd,marginInlineStart,spaceX,spaceY,outlineWidth,outlineColor,outline,outlineOffset,divideX,divideY,divideColor,divideStyle,width,inlineSize,minWidth,minInlineSize,maxWidth,maxInlineSize,height,blockSize,minHeight,minBlockSize,maxHeight,maxBlockSize,color,fontFamily,fontSize,fontSizeAdjust,fontPalette,fontKerning,fontFeatureSettings,fontWeight,fontSmoothing,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariationSettings,fontVariantNumeric,letterSpacing,lineHeight,textAlign,textDecoration,textDecorationColor,textEmphasisColor,textDecorationStyle,textDecorationThickness,textUnderlineOffset,textTransform,textIndent,textShadow,textOverflow,verticalAlign,wordBreak,textWrap,truncate,lineClamp,listStyleType,listStylePosition,listStyleImage,listStyle,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundAttachment,backgroundClip,background,backgroundColor,backgroundOrigin,backgroundImage,backgroundRepeat,backgroundBlendMode,backgroundSize,backgroundGradient,textGradient,gradientFromPosition,gradientToPosition,gradientFrom,gradientTo,gradientVia,gradientViaPosition,borderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomRightRadius,borderBottomLeftRadius,borderTopRadius,borderRightRadius,borderBottomRadius,borderLeftRadius,borderStartStartRadius,borderStartEndRadius,borderStartRadius,borderEndStartRadius,borderEndEndRadius,borderEndRadius,border,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,borderColor,borderInline,borderInlineWidth,borderInlineColor,borderBlock,borderBlockWidth,borderBlockColor,borderLeft,borderLeftColor,borderInlineStart,borderInlineStartWidth,borderInlineStartColor,borderRight,borderRightColor,borderInlineEnd,borderInlineEndWidth,borderInlineEndColor,borderTop,borderTopColor,borderBottom,borderBottomColor,borderBlockEnd,borderBlockEndColor,borderBlockStart,borderBlockStartColor,opacity,boxShadow,boxShadowColor,mixBlendMode,filter,brightness,contrast,grayscale,hueRotate,invert,saturate,sepia,dropShadow,blur,backdropFilter,backdropBlur,backdropBrightness,backdropContrast,backdropGrayscale,backdropHueRotate,backdropInvert,backdropOpacity,backdropSaturate,backdropSepia,borderCollapse,borderSpacing,borderSpacingX,borderSpacingY,tableLayout,transitionTimingFunction,transitionDelay,transitionDuration,transitionProperty,transition,animation,animationName,animationTimingFunction,animationDuration,animationDelay,animationPlayState,animationComposition,animationFillMode,animationDirection,animationIterationCount,animationRange,animationState,animationRangeStart,animationRangeEnd,animationTimeline,transformOrigin,transformBox,transformStyle,transform,rotate,rotateX,rotateY,rotateZ,scale,scaleX,scaleY,translate,translateX,translateY,translateZ,accentColor,caretColor,scrollBehavior,scrollbar,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollMargin,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollMarginBottom,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollPaddingBottom,scrollSnapAlign,scrollSnapStop,scrollSnapType,scrollSnapStrictness,scrollSnapMargin,scrollSnapMarginTop,scrollSnapMarginBottom,scrollSnapMarginLeft,scrollSnapMarginRight,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,touchAction,userSelect,overflow,overflowWrap,overflowX,overflowY,overflowAnchor,overflowBlock,overflowInline,overflowClipBox,overflowClipMargin,overscrollBehaviorBlock,overscrollBehaviorInline,fill,stroke,strokeWidth,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,srOnly,debug,appearance,backfaceVisibility,clipPath,hyphens,mask,maskImage,maskSize,textSizeAdjust,container,containerName,containerType,colorPalette,_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_starting,_collapsed,_current,_hidden,_off,_on,_today,_underValue,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,textStyle";
|
1185
|
-
var userGenerated = userGeneratedStr.split(",");
|
1186
|
-
var cssPropertiesStr = "WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationRange,animationRangeEnd,animationRangeStart,animationTimingFunction,animationTimeline,appearance,aspectRatio,azimuth,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockSize,border,borderBlock,borderBlockColor,borderBlockStyle,borderBlockWidth,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineEnd,borderInlineColor,borderInlineStyle,borderInlineWidth,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,color,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicSize,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,counterIncrement,counterReset,counterSet,cursor,direction,display,emptyCells,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontVariationSettings,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontSynthesisPosition,fontSynthesisSmallCaps,fontSynthesisStyle,fontSynthesisWeight,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inputSecurity,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overlay,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,printColorAdjust,quotes,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,scale,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockStart,scrollMarginBlockEnd,scrollMarginBottom,scrollMarginInline,scrollMarginInlineStart,scrollMarginInlineEnd,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineStart,scrollPaddingInlineEnd,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,shapeImageThreshold,shapeMargin,shapeOutside,tabSize,tableLayout,textAlign,textAlignLast,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textTransform,textUnderlineOffset,textUnderlinePosition,textWrap,timelineScope,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,verticalAlign,viewTimeline,viewTimelineAxis,viewTimelineInset,viewTimelineName,viewTransitionName,visibility,whiteSpace,whiteSpaceCollapse,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,zIndex,zoom,alignmentBaseline,baselineShift,clipRule,colorInterpolation,colorRendering,dominantBaseline,fill,fillOpacity,fillRule,floodColor,floodOpacity,glyphOrientationVertical,lightingColor,marker,markerEnd,markerMid,markerStart,shapeRendering,stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,strokeWidth,textAnchor,vectorEffect";
|
1187
|
-
var allCssProperties = cssPropertiesStr.split(",").concat(userGenerated);
|
1188
|
-
var properties = new Map(allCssProperties.map((prop) => [prop, true]));
|
1189
|
-
var cssPropertySelectorRegex = /&|@/;
|
1190
|
-
var isCssProperty = /* @__PURE__ */ memo((prop) => {
|
1191
|
-
return properties.has(prop) || prop.startsWith("--") || cssPropertySelectorRegex.test(prop);
|
1192
|
-
});
|
1193
|
-
|
1194
|
-
const defaultShouldForwardProp = (prop, variantKeys) => !variantKeys.includes(prop) && !isCssProperty(prop);
|
1195
|
-
|
1196
|
-
const composeShouldForwardProps = (tag, shouldForwardProp) =>
|
1197
|
-
tag.__shouldForwardProps__ && shouldForwardProp
|
1198
|
-
? (propName) => tag.__shouldForwardProps__(propName) && shouldForwardProp(propName)
|
1199
|
-
: shouldForwardProp;
|
1200
|
-
|
1201
|
-
const composeCvaFn = (cvaA, cvaB) => {
|
1202
|
-
if (cvaA && !cvaB) return cvaA
|
1203
|
-
if (!cvaA && cvaB) return cvaB
|
1204
|
-
if ((cvaA.__cva__ && cvaB.__cva__) || (cvaA.__recipe__ && cvaB.__recipe__)) return cvaA.merge(cvaB)
|
1205
|
-
const error = new TypeError('Cannot merge cva with recipe. Please use either cva or recipe.');
|
1206
|
-
TypeError.captureStackTrace?.(error);
|
1207
|
-
throw error
|
1208
|
-
};
|
1209
|
-
|
1210
|
-
const getDisplayName = (Component) => {
|
1211
|
-
if (typeof Component === 'string') return Component
|
1212
|
-
return Component?.displayName || Component?.name || 'Component'
|
1213
|
-
};
|
1214
|
-
|
1215
|
-
function styledFn(Dynamic, configOrCva = {}, options = {}) {
|
1216
|
-
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva);
|
1217
|
-
|
1218
|
-
const forwardFn = options.shouldForwardProp || defaultShouldForwardProp;
|
1219
|
-
const shouldForwardProp = (prop) => forwardFn(prop, cvaFn.variantKeys);
|
1220
|
-
|
1221
|
-
const defaultProps = Object.assign(
|
1222
|
-
options.dataAttr && configOrCva.__name__ ? { 'data-recipe': configOrCva.__name__ } : {},
|
1223
|
-
options.defaultProps,
|
1224
|
-
);
|
1225
|
-
|
1226
|
-
const __cvaFn__ = composeCvaFn(Dynamic.__cva__, cvaFn);
|
1227
|
-
const __shouldForwardProps__ = composeShouldForwardProps(Dynamic, shouldForwardProp);
|
1228
|
-
const __base__ = Dynamic.__base__ || Dynamic;
|
1229
|
-
|
1230
|
-
const StyledComponent = /* @__PURE__ */ forwardRef(function StyledComponent(props, ref) {
|
1231
|
-
const { as: Element = __base__, children, ...restProps } = props;
|
1232
|
-
|
1233
|
-
const combinedProps = useMemo(() => Object.assign({}, defaultProps, restProps), [restProps]);
|
1234
|
-
|
1235
|
-
const [htmlProps, forwardedProps, variantProps, styleProps, elementProps] = useMemo(() => {
|
1236
|
-
return splitProps(combinedProps, normalizeHTMLProps.keys, __shouldForwardProps__, __cvaFn__.variantKeys, isCssProperty)
|
1237
|
-
}, [combinedProps]);
|
1238
|
-
|
1239
|
-
function recipeClass() {
|
1240
|
-
const { css: cssStyles, ...propStyles } = styleProps;
|
1241
|
-
const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
|
1242
|
-
return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.className)
|
1243
|
-
}
|
1244
|
-
|
1245
|
-
function cvaClass() {
|
1246
|
-
const { css: cssStyles, ...propStyles } = styleProps;
|
1247
|
-
const cvaStyles = __cvaFn__.raw(variantProps);
|
1248
|
-
return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.className)
|
1249
|
-
}
|
1250
|
-
|
1251
|
-
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass;
|
1252
|
-
|
1253
|
-
return createElement(Element, {
|
1254
|
-
ref,
|
1255
|
-
...forwardedProps,
|
1256
|
-
...elementProps,
|
1257
|
-
...normalizeHTMLProps(htmlProps),
|
1258
|
-
className: classes(),
|
1259
|
-
}, combinedProps.children ?? children)
|
1260
|
-
});
|
1261
|
-
|
1262
|
-
const name = getDisplayName(__base__);
|
1263
|
-
|
1264
|
-
StyledComponent.displayName = `styled.${name}`;
|
1265
|
-
StyledComponent.__cva__ = __cvaFn__;
|
1266
|
-
StyledComponent.__base__ = __base__;
|
1267
|
-
StyledComponent.__shouldForwardProps__ = shouldForwardProp;
|
1268
|
-
|
1269
|
-
return StyledComponent
|
1270
|
-
}
|
1271
|
-
|
1272
|
-
function createJsxFactory() {
|
1273
|
-
const cache = new Map();
|
1274
|
-
|
1275
|
-
return new Proxy(styledFn, {
|
1276
|
-
apply(_, __, args) {
|
1277
|
-
return styledFn(...args)
|
1278
|
-
},
|
1279
|
-
get(_, el) {
|
1280
|
-
if (!cache.has(el)) {
|
1281
|
-
cache.set(el, styledFn(el));
|
1282
|
-
}
|
1283
|
-
return cache.get(el)
|
1284
|
-
},
|
1285
|
-
})
|
1286
|
-
}
|
1287
|
-
|
1288
|
-
const styled = /* @__PURE__ */ createJsxFactory();
|
1289
|
-
|
1290
|
-
const centerConfig = {
|
1291
|
-
transform(props) {
|
1292
|
-
const { inline, ...rest } = props;
|
1293
|
-
return {
|
1294
|
-
display: inline ? "inline-flex" : "flex",
|
1295
|
-
alignItems: "center",
|
1296
|
-
justifyContent: "center",
|
1297
|
-
...rest
|
1298
|
-
};
|
1299
|
-
}};
|
1300
|
-
|
1301
|
-
const getCenterStyle = (styles = {}) => {
|
1302
|
-
const _styles = getPatternStyles(centerConfig, styles);
|
1303
|
-
return centerConfig.transform(_styles, patternFns)
|
1304
|
-
};
|
1305
|
-
|
1306
|
-
const Center = /* @__PURE__ */ forwardRef(function Center(props, ref) {
|
1307
|
-
const [patternProps, restProps] = splitProps(props, ["inline"]);
|
1308
|
-
|
1309
|
-
const styleProps = getCenterStyle(patternProps);
|
1310
|
-
const mergedProps = { ref, ...styleProps, ...restProps };
|
1311
|
-
|
1312
|
-
return createElement(styled.div, mergedProps)
|
1313
|
-
});
|
1314
|
-
|
1315
|
-
const createRecipe = (name, defaultVariants, compoundVariants) => {
|
1316
|
-
const getVariantProps = (variants) => {
|
1317
|
-
return {
|
1318
|
-
[name]: '__ignore__',
|
1319
|
-
...defaultVariants,
|
1320
|
-
...compact(variants),
|
1321
|
-
};
|
1322
|
-
};
|
1323
|
-
|
1324
|
-
const recipeFn = (variants, withCompoundVariants = true) => {
|
1325
|
-
const transform = (prop, value) => {
|
1326
|
-
assertCompoundVariant(name, compoundVariants, variants, prop);
|
1327
|
-
|
1328
|
-
if (value === '__ignore__') {
|
1329
|
-
return { className: name }
|
1330
|
-
}
|
1331
|
-
|
1332
|
-
value = withoutSpace(value);
|
1333
|
-
return { className: `${name}--${prop}_${value}` }
|
1334
|
-
};
|
1335
|
-
|
1336
|
-
const recipeCss = createCss({
|
1337
|
-
|
1338
|
-
conditions: {
|
1339
|
-
shift: sortConditions,
|
1340
|
-
finalize: finalizeConditions,
|
1341
|
-
breakpoints: { keys: ["base","sm","md","lg","xl","2xl"] }
|
1342
|
-
},
|
1343
|
-
utility: {
|
1344
|
-
|
1345
|
-
toHash: (path, hashFn) => hashFn(path.join(":")),
|
1346
|
-
transform,
|
1347
|
-
}
|
1348
|
-
});
|
1349
|
-
|
1350
|
-
const recipeStyles = getVariantProps(variants);
|
1351
|
-
|
1352
|
-
if (withCompoundVariants) {
|
1353
|
-
const compoundVariantStyles = getCompoundVariantCss(compoundVariants, recipeStyles);
|
1354
|
-
return cx(recipeCss(recipeStyles), css(compoundVariantStyles))
|
1355
|
-
}
|
1356
|
-
|
1357
|
-
return recipeCss(recipeStyles)
|
1358
|
-
};
|
1359
|
-
|
1360
|
-
return {
|
1361
|
-
recipeFn,
|
1362
|
-
getVariantProps,
|
1363
|
-
__getCompoundVariantCss__: (variants) => {
|
1364
|
-
return getCompoundVariantCss(compoundVariants, getVariantProps(variants));
|
1365
|
-
},
|
1366
|
-
}
|
1367
|
-
};
|
1368
|
-
|
1369
|
-
const mergeRecipes = (recipeA, recipeB) => {
|
1370
|
-
if (recipeA && !recipeB) return recipeA
|
1371
|
-
if (!recipeA && recipeB) return recipeB
|
1372
|
-
|
1373
|
-
const recipeFn = (...args) => cx(recipeA(...args), recipeB(...args));
|
1374
|
-
const variantKeys = uniq(recipeA.variantKeys, recipeB.variantKeys);
|
1375
|
-
const variantMap = variantKeys.reduce((acc, key) => {
|
1376
|
-
acc[key] = uniq(recipeA.variantMap[key], recipeB.variantMap[key]);
|
1377
|
-
return acc
|
1378
|
-
}, {});
|
1379
|
-
|
1380
|
-
return Object.assign(recipeFn, {
|
1381
|
-
__recipe__: true,
|
1382
|
-
__name__: `${recipeA.__name__} ${recipeB.__name__}`,
|
1383
|
-
raw: (props) => props,
|
1384
|
-
variantKeys,
|
1385
|
-
variantMap,
|
1386
|
-
splitVariantProps(props) {
|
1387
|
-
return splitProps(props, variantKeys)
|
1388
|
-
},
|
1389
|
-
})
|
1390
|
-
};
|
1391
|
-
|
1392
|
-
const buttonFn = /* @__PURE__ */ createRecipe('button', {
|
1393
|
-
"variant": "solid",
|
1394
|
-
"size": "md"
|
1395
|
-
}, []);
|
1396
|
-
|
1397
|
-
const buttonVariantMap = {
|
1398
|
-
"variant": [
|
1399
|
-
"solid",
|
1400
|
-
"outline",
|
1401
|
-
"ghost",
|
1402
|
-
"link",
|
1403
|
-
"subtle"
|
1404
|
-
],
|
1405
|
-
"size": [
|
1406
|
-
"xs",
|
1407
|
-
"sm",
|
1408
|
-
"md",
|
1409
|
-
"lg",
|
1410
|
-
"xl",
|
1411
|
-
"2xl"
|
1412
|
-
]
|
1413
|
-
};
|
1414
|
-
|
1415
|
-
const buttonVariantKeys = Object.keys(buttonVariantMap);
|
1416
|
-
|
1417
|
-
const button = /* @__PURE__ */ Object.assign(memo(buttonFn.recipeFn), {
|
1418
|
-
__recipe__: true,
|
1419
|
-
__name__: 'button',
|
1420
|
-
__getCompoundVariantCss__: buttonFn.__getCompoundVariantCss__,
|
1421
|
-
raw: (props) => props,
|
1422
|
-
variantKeys: buttonVariantKeys,
|
1423
|
-
variantMap: buttonVariantMap,
|
1424
|
-
merge(recipe) {
|
1425
|
-
return mergeRecipes(this, recipe)
|
1426
|
-
},
|
1427
|
-
splitVariantProps(props) {
|
1428
|
-
return splitProps(props, buttonVariantKeys)
|
1429
|
-
},
|
1430
|
-
getVariantProps: buttonFn.getVariantProps,
|
1431
|
-
});
|
1432
|
-
|
1433
|
-
const spinnerFn = /* @__PURE__ */ createRecipe('spinner', {
|
1434
|
-
"size": "md"
|
1435
|
-
}, []);
|
1436
|
-
|
1437
|
-
const spinnerVariantMap = {
|
1438
|
-
"size": [
|
1439
|
-
"xs",
|
1440
|
-
"sm",
|
1441
|
-
"md",
|
1442
|
-
"lg",
|
1443
|
-
"xl"
|
1444
|
-
]
|
1445
|
-
};
|
1446
|
-
|
1447
|
-
const spinnerVariantKeys = Object.keys(spinnerVariantMap);
|
1448
|
-
|
1449
|
-
const spinner = /* @__PURE__ */ Object.assign(memo(spinnerFn.recipeFn), {
|
1450
|
-
__recipe__: true,
|
1451
|
-
__name__: 'spinner',
|
1452
|
-
__getCompoundVariantCss__: spinnerFn.__getCompoundVariantCss__,
|
1453
|
-
raw: (props) => props,
|
1454
|
-
variantKeys: spinnerVariantKeys,
|
1455
|
-
variantMap: spinnerVariantMap,
|
1456
|
-
merge(recipe) {
|
1457
|
-
return mergeRecipes(this, recipe)
|
1458
|
-
},
|
1459
|
-
splitVariantProps(props) {
|
1460
|
-
return splitProps(props, spinnerVariantKeys)
|
1461
|
-
},
|
1462
|
-
getVariantProps: spinnerFn.getVariantProps,
|
1463
|
-
});
|
1464
|
-
|
1465
|
-
const Spinner$1 = styled(ark.div, spinner);
|
1466
|
-
|
1467
|
-
const Spinner = forwardRef((props, ref) => {
|
1468
|
-
const { label = 'Loading...', ...rest } = props;
|
1469
|
-
return (jsx(Spinner$1, { ref: ref, borderBottomColor: 'transparent', borderLeftColor: 'transparent', ...rest, children: label && jsx(styled.span, { srOnly: true, children: label }) }));
|
1470
|
-
});
|
1471
|
-
Spinner.displayName = 'Spinner';
|
1472
|
-
|
1473
|
-
const Button$1 = styled(ark.button, button);
|
1474
|
-
|
1475
|
-
const Button = forwardRef((props, ref) => {
|
1476
|
-
const { loading, disabled, loadingText, children, ...rest } = props;
|
1477
|
-
const trulyDisabled = loading || disabled;
|
1478
|
-
return (jsx(Button$1, { disabled: trulyDisabled, ref: ref, ...rest, children: loading && !loadingText ? (jsxs(Fragment, { children: [jsx(ButtonSpinner, {}), jsx(styled.span, { opacity: 0, children: children })] })) : loadingText ? (loadingText) : (children) }));
|
1479
|
-
});
|
1480
|
-
Button.displayName = 'Button';
|
1481
|
-
const ButtonSpinner = () => (jsx(Center, { inline: true, position: 'absolute', transform: 'translate(-50%, -50%)', top: '50%', insetStart: '50%', children: jsx(Spinner, { colorPalette: 'gray' }) }));
|
1482
|
-
|
1483
|
-
export { Button, IntegrationAppProvider, useAction, useActionInstance, useActionInstances, useActions, useAppDataSchema, useAppDataSchemaInstance, useAppDataSchemaInstances, useAppDataSchemas, useAppEventSubscription, useAppEventSubscriptions, useAppEventType, useAppEventTypes, useAppEvents, useConnection, useConnections, useConnectorSpec, useCustomer, useCustomers, useDataCollectionSpec, useDataLinkTable, useDataLinkTableInstance, useDataLinkTableInstances, useDataLinkTables, useDataSource, useDataSourceInstance, useDataSourceInstanceCollection, useDataSourceInstances, useDataSources, useExternalEventSubscription, useExternalEventSubscriptions, useFieldMapping, useFieldMappingInstance, useFieldMappingInstances, useFieldMappings, useFlow, useFlowInstance, useFlowInstances, useFlowRun, useFlowRuns, useFlows, useIntegration, useIntegrationApp, useIntegrationAppSWR, useIntegrationElement, useIntegrations, useScenario, useScenarios, useScreen };
|
1484
|
-
//# sourceMappingURL=index.module.mjs.map
|