@cloudscape-design/components 3.0.820 → 3.0.822
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app-layout/utils/use-drawers.d.ts.map +1 -1
- package/app-layout/utils/use-drawers.js +5 -1
- package/app-layout/utils/use-drawers.js.map +1 -1
- package/file-upload/internal.d.ts.map +1 -1
- package/file-upload/internal.js +4 -4
- package/file-upload/internal.js.map +1 -1
- package/icon/generated/icons.d.ts +26 -0
- package/icon/generated/icons.d.ts.map +1 -1
- package/icon/generated/icons.js +81 -4
- package/icon/generated/icons.js.map +1 -1
- package/icon/interfaces.d.ts +1 -1
- package/icon/interfaces.d.ts.map +1 -1
- package/icon/interfaces.js.map +1 -1
- package/internal/components/file-input/index.d.ts +6 -0
- package/internal/components/file-input/index.d.ts.map +1 -0
- package/{file-upload → internal/components}/file-input/index.js +24 -16
- package/internal/components/file-input/index.js.map +1 -0
- package/internal/components/file-input/interfaces.d.ts +53 -0
- package/internal/components/file-input/interfaces.d.ts.map +1 -0
- package/internal/components/file-input/interfaces.js +2 -0
- package/internal/components/file-input/interfaces.js.map +1 -0
- package/internal/components/file-input/styles.css.js +10 -0
- package/{file-upload → internal/components}/file-input/styles.scoped.css +9 -12
- package/internal/components/file-input/styles.selectors.js +11 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/s3-resource-selector/s3-modal/index.d.ts.map +1 -1
- package/s3-resource-selector/s3-modal/index.js +2 -1
- package/s3-resource-selector/s3-modal/index.js.map +1 -1
- package/s3-resource-selector/test-classes/styles.css.js +6 -0
- package/s3-resource-selector/test-classes/styles.scoped.css +7 -0
- package/s3-resource-selector/test-classes/styles.selectors.js +7 -0
- package/table/body-cell/disabled-inline-editor.d.ts +1 -1
- package/table/body-cell/disabled-inline-editor.d.ts.map +1 -1
- package/table/body-cell/disabled-inline-editor.js +4 -4
- package/table/body-cell/disabled-inline-editor.js.map +1 -1
- package/table/body-cell/index.d.ts +0 -1
- package/table/body-cell/index.d.ts.map +1 -1
- package/table/body-cell/index.js +4 -4
- package/table/body-cell/index.js.map +1 -1
- package/table/body-cell/styles.css.js +46 -47
- package/table/body-cell/styles.scoped.css +301 -331
- package/table/body-cell/styles.selectors.js +46 -47
- package/test-utils/dom/file-upload/index.js +16 -16
- package/test-utils/dom/file-upload/index.js.map +1 -1
- package/test-utils/dom/internal/file-input.d.ts +7 -0
- package/test-utils/dom/internal/file-input.js +18 -0
- package/test-utils/dom/internal/file-input.js.map +1 -0
- package/test-utils/dom/s3-resource-selector/index.js +2 -1
- package/test-utils/dom/s3-resource-selector/index.js.map +1 -1
- package/test-utils/selectors/file-upload/index.js +16 -16
- package/test-utils/selectors/file-upload/index.js.map +1 -1
- package/test-utils/selectors/internal/file-input.d.ts +7 -0
- package/test-utils/selectors/internal/file-input.js +18 -0
- package/test-utils/selectors/internal/file-input.js.map +1 -0
- package/test-utils/selectors/s3-resource-selector/index.js +2 -1
- package/test-utils/selectors/s3-resource-selector/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/file-upload/file-input/index.d.ts +0 -14
- package/file-upload/file-input/index.d.ts.map +0 -1
- package/file-upload/file-input/index.js.map +0 -1
- package/file-upload/file-input/styles.css.js +0 -9
- package/file-upload/file-input/styles.selectors.js +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-drawers.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-drawers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/C,eAAO,MAAM,eAAe,yBAAyB,CAAC;AAEtD,UAAU,UAAU;IAClB,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB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AK,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACnC,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IAC9C,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAsJD,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,KAAK,eAAe,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,CAAC,GAAG;IAC7F,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,wBAAgB,UAAU,CACxB,EACE,OAAO,EACP,cAAc,EAAE,wBAAwB,EACxC,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EAAE,qBAAqB,GAC/C,EAAE,eAAe,EAClB,UAAU,EAAE,cAAc,CAAC,YAAY,CAAC,EACxC,UAAU,EAAE,UAAU;;;;;;;;;;;;;;wCAmBqB,MAAM,GAAG,IAAI;;YAPN,MAAM;cAAQ,MAAM;;4CA2BvB,MAAM;EAiFtD"}
|
|
@@ -186,7 +186,11 @@ export function useDrawers({ drawers, activeDrawerId: controlledActiveDrawerId,
|
|
|
186
186
|
? [...localBefore, ...drawers, ...localAfter]
|
|
187
187
|
: applyToolsDrawer(toolsProps, runtimeDrawers);
|
|
188
188
|
// support toolsOpen in runtime-drawers-only mode
|
|
189
|
-
let activeDrawerIdResolved = (toolsProps === null || toolsProps === void 0 ? void 0 : toolsProps.toolsOpen) && !hasOwnDrawers
|
|
189
|
+
let activeDrawerIdResolved = (toolsProps === null || toolsProps === void 0 ? void 0 : toolsProps.toolsOpen) && !hasOwnDrawers
|
|
190
|
+
? TOOLS_DRAWER_ID
|
|
191
|
+
: activeDrawerId !== TOOLS_DRAWER_ID
|
|
192
|
+
? activeDrawerId
|
|
193
|
+
: null;
|
|
190
194
|
const activeDrawer = combinedLocalDrawers === null || combinedLocalDrawers === void 0 ? void 0 : combinedLocalDrawers.find(drawer => drawer.id === activeDrawerIdResolved);
|
|
191
195
|
// ensure that id is only defined when the drawer exists
|
|
192
196
|
activeDrawerIdResolved = (_a = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id) !== null && _a !== void 0 ? _a : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-drawers.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-drawers.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAiB,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAYtD,SAAS,kBAAkB,CAAC,KAAiB;IAC3C,IAAI,KAAK,CAAC,SAAS,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC;IACpD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,CA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YAAY;QACZ,cAAc,EAAE,sBAAsB;QACtC,aAAa,EAAE,oBAAoB;QACnC,mBAAmB,EAAE,mBAAmB;QACxC,sBAAsB;QACtB,wBAAwB;QACxB,gBAAgB;QAChB,aAAa;QACb,qBAAqB;QACrB,WAAW;QACX,gBAAgB,EAAE,gBAAgB,CAAC,OAAO;QAC1C,oBAAoB;QACpB,oBAAoB;QACpB,2BAA2B;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { awsuiPluginsInternal } from '../../internal/plugins/api';\nimport { sortByPriority } from '../../internal/plugins/helpers/utils';\nimport { AppLayoutProps } from '../interfaces';\nimport { convertRuntimeDrawers, DrawersLayout } from '../runtime-drawer';\nimport { togglesConfig } from '../toggles';\n\nexport const TOOLS_DRAWER_ID = 'awsui-internal-tools';\n\ninterface ToolsProps {\n toolsHide: boolean | undefined;\n toolsOpen: boolean | undefined;\n toolsWidth: number;\n tools: React.ReactNode | undefined;\n onToolsToggle: (newOpen: boolean) => void;\n ariaLabels: AppLayoutProps.Labels | undefined;\n disableDrawersMerge?: boolean;\n}\n\nfunction getToolsDrawerItem(props: ToolsProps): AppLayoutProps.Drawer | null {\n if (props.toolsHide) {\n return null;\n }\n const { iconName, getLabels } = togglesConfig.tools;\n const { mainLabel, closeLabel, openLabel } = getLabels(props.ariaLabels);\n return {\n id: TOOLS_DRAWER_ID,\n content: props.tools,\n resizable: false,\n ariaLabels: {\n triggerButton: openLabel,\n closeButton: closeLabel,\n drawerName: mainLabel ?? '',\n },\n trigger: {\n iconName: iconName,\n },\n };\n}\n\nconst DRAWERS_LIMIT = 2;\n\nfunction useRuntimeDrawers(\n disableRuntimeDrawers: boolean | undefined,\n activeDrawerId: string | null,\n onActiveDrawerChange: (newDrawerId: string | null) => void,\n activeGlobalDrawersIds: Array<string>,\n onActiveGlobalDrawersChange: (newDrawerId: string) => void,\n drawers: AppLayoutProps.Drawer[]\n) {\n const [runtimeDrawers, setRuntimeDrawers] = useState<DrawersLayout>({\n localBefore: [],\n localAfter: [],\n global: [],\n });\n const onLocalDrawerChangeStable = useStableCallback(onActiveDrawerChange);\n const onGlobalDrawersChangeStable = useStableCallback(onActiveGlobalDrawersChange);\n\n const localDrawerWasOpenRef = useRef(false);\n localDrawerWasOpenRef.current = localDrawerWasOpenRef.current || !!activeDrawerId;\n const activeGlobalDrawersIdsRef = useRef<Array<string>>([]);\n activeGlobalDrawersIdsRef.current = activeGlobalDrawersIds;\n\n useEffect(() => {\n if (disableRuntimeDrawers) {\n return;\n }\n const unsubscribe = awsuiPluginsInternal.appLayout.onDrawersRegistered(drawers => {\n const localDrawers = drawers.filter(drawer => drawer.type !== 'global');\n const globalDrawers = drawers.filter(drawer => drawer.type === 'global');\n setRuntimeDrawers(convertRuntimeDrawers(localDrawers, globalDrawers));\n if (!localDrawerWasOpenRef.current) {\n const defaultActiveLocalDrawer = sortByPriority(localDrawers).find(drawer => drawer.defaultActive);\n if (defaultActiveLocalDrawer) {\n onLocalDrawerChangeStable(defaultActiveLocalDrawer.id);\n }\n }\n\n const drawersNotActiveByDefault = globalDrawers.filter(drawer => !drawer.defaultActive);\n const hasDrawersOpenByUserAction = drawersNotActiveByDefault.find(drawer =>\n activeGlobalDrawersIdsRef.current.includes(drawer.id)\n );\n if (hasDrawersOpenByUserAction || activeGlobalDrawersIdsRef.current.length === DRAWERS_LIMIT) {\n return;\n }\n\n const defaultActiveGlobalDrawers = sortByPriority(globalDrawers).filter(\n drawer => !activeGlobalDrawersIdsRef.current.includes(drawer.id) && drawer.defaultActive\n );\n defaultActiveGlobalDrawers.forEach(drawer => {\n onGlobalDrawersChangeStable(drawer.id);\n });\n });\n return () => {\n unsubscribe();\n setRuntimeDrawers({ localBefore: [], localAfter: [], global: [] });\n };\n }, [disableRuntimeDrawers, onGlobalDrawersChangeStable, onLocalDrawerChangeStable]);\n\n useEffect(() => {\n const unsubscribe = awsuiPluginsInternal.appLayout.onDrawerOpened(drawerId => {\n const localDrawer = [...runtimeDrawers.localBefore, ...drawers, ...runtimeDrawers.localAfter]?.find(\n drawer => drawer.id === drawerId\n );\n const globalDrawer = runtimeDrawers.global?.find(drawer => drawer.id === drawerId);\n if (localDrawer && activeDrawerId !== drawerId) {\n onActiveDrawerChange(drawerId);\n }\n if (globalDrawer && !activeGlobalDrawersIds.includes(drawerId)) {\n onActiveGlobalDrawersChange(drawerId);\n }\n });\n\n return () => {\n unsubscribe();\n };\n }, [\n activeDrawerId,\n activeGlobalDrawersIds,\n drawers,\n onActiveDrawerChange,\n runtimeDrawers,\n onActiveGlobalDrawersChange,\n ]);\n\n useEffect(() => {\n const unsubscribe = awsuiPluginsInternal.appLayout.onDrawerClosed(drawerId => {\n const localDrawer = [...runtimeDrawers.localBefore, ...drawers, ...runtimeDrawers.localAfter]?.find(\n drawer => drawer.id === drawerId\n );\n const globalDrawer = runtimeDrawers.global?.find(drawer => drawer.id === drawerId);\n if (localDrawer && activeDrawerId === drawerId) {\n onActiveDrawerChange(null);\n }\n if (globalDrawer && activeGlobalDrawersIds.includes(drawerId)) {\n onActiveGlobalDrawersChange(drawerId);\n }\n });\n\n return () => {\n unsubscribe();\n };\n }, [\n activeDrawerId,\n activeGlobalDrawersIds,\n drawers,\n onActiveDrawerChange,\n runtimeDrawers,\n onActiveGlobalDrawersChange,\n ]);\n\n return runtimeDrawers;\n}\n\nfunction applyToolsDrawer(toolsProps: ToolsProps, runtimeDrawers: DrawersLayout) {\n const drawers = [...runtimeDrawers.localBefore, ...runtimeDrawers.localAfter];\n if (drawers.length === 0 && toolsProps.disableDrawersMerge) {\n return null;\n }\n const toolsItem = getToolsDrawerItem(toolsProps);\n if (toolsItem) {\n drawers.unshift(toolsItem);\n }\n\n return drawers;\n}\n\nexport const MIN_DRAWER_SIZE = 290;\n\ntype UseDrawersProps = Pick<AppLayoutProps, 'drawers' | 'activeDrawerId' | 'onDrawerChange'> & {\n __disableRuntimeDrawers?: boolean;\n onGlobalDrawerFocus?: (drawerId: string, open: boolean) => void;\n onAddNewActiveDrawer?: (drawerId: string) => void;\n};\n\nexport function useDrawers(\n {\n drawers,\n activeDrawerId: controlledActiveDrawerId,\n onDrawerChange,\n onGlobalDrawerFocus,\n onAddNewActiveDrawer,\n __disableRuntimeDrawers: disableRuntimeDrawers,\n }: UseDrawersProps,\n ariaLabels: AppLayoutProps['ariaLabels'],\n toolsProps: ToolsProps\n) {\n const [activeDrawerId = null, setActiveDrawerId] = useControllable(controlledActiveDrawerId, onDrawerChange, null, {\n componentName: 'AppLayout',\n controlledProp: 'activeDrawerId',\n changeHandler: 'onChange',\n });\n const [activeGlobalDrawersIds, setActiveGlobalDrawersIds] = useState<Array<string>>([]);\n const [drawerSizes, setDrawerSizes] = useState<Record<string, number>>({});\n // FIFO queue that keeps track of open drawers, where the first element is the most recently opened drawer\n const drawersOpenQueue = useRef<Array<string>>([]);\n\n function onActiveDrawerResize({ id, size }: { id: string; size: number }) {\n setDrawerSizes(oldSizes => ({ ...oldSizes, [id]: size }));\n fireNonCancelableEvent(activeDrawer?.onResize, { id, size });\n const activeGlobalDrawer = runtimeGlobalDrawers.find(drawer => drawer.id === id);\n fireNonCancelableEvent(activeGlobalDrawer?.onResize, { id, size });\n }\n\n function onActiveDrawerChange(newDrawerId: string | null) {\n setActiveDrawerId(newDrawerId);\n if (newDrawerId) {\n onAddNewActiveDrawer?.(newDrawerId);\n }\n if (hasOwnDrawers) {\n fireNonCancelableEvent(onDrawerChange, { activeDrawerId: newDrawerId });\n } else if (!toolsProps.toolsHide) {\n toolsProps.onToolsToggle(newDrawerId === TOOLS_DRAWER_ID);\n }\n\n if (newDrawerId) {\n drawersOpenQueue.current = [newDrawerId, ...drawersOpenQueue.current];\n }\n\n if (activeDrawerId) {\n drawersOpenQueue.current = drawersOpenQueue.current.filter(id => id !== activeDrawerId);\n }\n }\n\n function onActiveGlobalDrawersChange(drawerId: string) {\n if (activeGlobalDrawersIds.includes(drawerId)) {\n setActiveGlobalDrawersIds(currentState => currentState.filter(id => id !== drawerId));\n onGlobalDrawerFocus?.(drawerId, false);\n drawersOpenQueue.current = drawersOpenQueue.current.filter(id => id !== drawerId);\n } else if (drawerId) {\n onAddNewActiveDrawer?.(drawerId);\n setActiveGlobalDrawersIds(currentState => [drawerId, ...currentState].slice(0, DRAWERS_LIMIT!));\n onGlobalDrawerFocus?.(drawerId, true);\n drawersOpenQueue.current = [drawerId, ...drawersOpenQueue.current];\n }\n }\n\n const hasOwnDrawers = !!drawers;\n const runtimeDrawers = useRuntimeDrawers(\n disableRuntimeDrawers,\n activeDrawerId,\n onActiveDrawerChange,\n activeGlobalDrawersIds,\n onActiveGlobalDrawersChange,\n drawers ?? []\n );\n const { localBefore, localAfter, global: runtimeGlobalDrawers } = runtimeDrawers;\n const combinedLocalDrawers = drawers\n ? [...localBefore, ...drawers, ...localAfter]\n : applyToolsDrawer(toolsProps, runtimeDrawers);\n // support toolsOpen in runtime-drawers-only mode\n let activeDrawerIdResolved = toolsProps?.toolsOpen && !hasOwnDrawers ? TOOLS_DRAWER_ID : activeDrawerId;\n const activeDrawer = combinedLocalDrawers?.find(drawer => drawer.id === activeDrawerIdResolved);\n // ensure that id is only defined when the drawer exists\n activeDrawerIdResolved = activeDrawer?.id ?? null;\n const activeGlobalDrawers = runtimeGlobalDrawers.filter(drawer => activeGlobalDrawersIds.includes(drawer.id));\n\n const activeDrawerSize = activeDrawerIdResolved\n ? drawerSizes[activeDrawerIdResolved] ?? activeDrawer?.defaultSize ?? toolsProps.toolsWidth\n : toolsProps.toolsWidth;\n const activeGlobalDrawersSizes: Record<string, number> = activeGlobalDrawersIds.reduce(\n (acc, currentGlobalDrawerId) => {\n const currentGlobalDrawer = runtimeGlobalDrawers.find(drawer => drawer.id === currentGlobalDrawerId);\n return {\n ...acc,\n [currentGlobalDrawerId]:\n drawerSizes[currentGlobalDrawerId] ?? currentGlobalDrawer?.defaultSize ?? MIN_DRAWER_SIZE,\n };\n },\n {}\n );\n const minGlobalDrawersSizes: Record<string, number> = runtimeGlobalDrawers.reduce((acc, globalDrawer) => {\n return {\n ...acc,\n [globalDrawer.id]: Math.min(globalDrawer.defaultSize ?? MIN_DRAWER_SIZE, MIN_DRAWER_SIZE),\n };\n }, {});\n const minDrawerSize = Math.min(\n toolsProps?.toolsOpen ? toolsProps.toolsWidth : activeDrawer?.defaultSize ?? MIN_DRAWER_SIZE,\n MIN_DRAWER_SIZE\n );\n\n return {\n ariaLabelsWithDrawers: ariaLabels,\n drawers: combinedLocalDrawers || undefined,\n activeDrawer,\n activeDrawerId: activeDrawerIdResolved,\n globalDrawers: runtimeGlobalDrawers,\n activeGlobalDrawers: activeGlobalDrawers,\n activeGlobalDrawersIds,\n activeGlobalDrawersSizes,\n activeDrawerSize,\n minDrawerSize,\n minGlobalDrawersSizes,\n drawerSizes,\n drawersOpenQueue: drawersOpenQueue.current,\n onActiveDrawerChange,\n onActiveDrawerResize,\n onActiveGlobalDrawersChange,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use-drawers.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-drawers.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAE,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C,GAAG,CAAC,MAAA,YAAY,CAAC,WAAW,mCAAI,eAAe,EAAE,eAAe,CAAC,IACzF;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAC5B,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,EAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,mCAAI,eAAe,EAC5F,eAAe,CAChB,CAAC;IAEF,OAAO;QACL,qBAAqB,EAAE,UAAU;QACjC,OAAO,EAAE,oBAAoB,IAAI,SAAS;QAC1C,YAAY;QACZ,cAAc,EAAE,sBAAsB;QACtC,aAAa,EAAE,oBAAoB;QACnC,mBAAmB,EAAE,mBAAmB;QACxC,sBAAsB;QACtB,wBAAwB;QACxB,gBAAgB;QAChB,aAAa;QACb,qBAAqB;QACrB,WAAW;QACX,gBAAgB,EAAE,gBAAgB,CAAC,OAAO;QAC1C,oBAAoB;QACpB,oBAAoB;QACpB,2BAA2B;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { awsuiPluginsInternal } from '../../internal/plugins/api';\nimport { sortByPriority } from '../../internal/plugins/helpers/utils';\nimport { AppLayoutProps } from '../interfaces';\nimport { convertRuntimeDrawers, DrawersLayout } from '../runtime-drawer';\nimport { togglesConfig } from '../toggles';\n\nexport const TOOLS_DRAWER_ID = 'awsui-internal-tools';\n\ninterface ToolsProps {\n toolsHide: boolean | undefined;\n toolsOpen: boolean | undefined;\n toolsWidth: number;\n tools: React.ReactNode | undefined;\n onToolsToggle: (newOpen: boolean) => void;\n ariaLabels: AppLayoutProps.Labels | undefined;\n disableDrawersMerge?: boolean;\n}\n\nfunction getToolsDrawerItem(props: ToolsProps): AppLayoutProps.Drawer | null {\n if (props.toolsHide) {\n return null;\n }\n const { iconName, getLabels } = togglesConfig.tools;\n const { mainLabel, closeLabel, openLabel } = getLabels(props.ariaLabels);\n return {\n id: TOOLS_DRAWER_ID,\n content: props.tools,\n resizable: false,\n ariaLabels: {\n triggerButton: openLabel,\n closeButton: closeLabel,\n drawerName: mainLabel ?? '',\n },\n trigger: {\n iconName: iconName,\n },\n };\n}\n\nconst DRAWERS_LIMIT = 2;\n\nfunction useRuntimeDrawers(\n disableRuntimeDrawers: boolean | undefined,\n activeDrawerId: string | null,\n onActiveDrawerChange: (newDrawerId: string | null) => void,\n activeGlobalDrawersIds: Array<string>,\n onActiveGlobalDrawersChange: (newDrawerId: string) => void,\n drawers: AppLayoutProps.Drawer[]\n) {\n const [runtimeDrawers, setRuntimeDrawers] = useState<DrawersLayout>({\n localBefore: [],\n localAfter: [],\n global: [],\n });\n const onLocalDrawerChangeStable = useStableCallback(onActiveDrawerChange);\n const onGlobalDrawersChangeStable = useStableCallback(onActiveGlobalDrawersChange);\n\n const localDrawerWasOpenRef = useRef(false);\n localDrawerWasOpenRef.current = localDrawerWasOpenRef.current || !!activeDrawerId;\n const activeGlobalDrawersIdsRef = useRef<Array<string>>([]);\n activeGlobalDrawersIdsRef.current = activeGlobalDrawersIds;\n\n useEffect(() => {\n if (disableRuntimeDrawers) {\n return;\n }\n const unsubscribe = awsuiPluginsInternal.appLayout.onDrawersRegistered(drawers => {\n const localDrawers = drawers.filter(drawer => drawer.type !== 'global');\n const globalDrawers = drawers.filter(drawer => drawer.type === 'global');\n setRuntimeDrawers(convertRuntimeDrawers(localDrawers, globalDrawers));\n if (!localDrawerWasOpenRef.current) {\n const defaultActiveLocalDrawer = sortByPriority(localDrawers).find(drawer => drawer.defaultActive);\n if (defaultActiveLocalDrawer) {\n onLocalDrawerChangeStable(defaultActiveLocalDrawer.id);\n }\n }\n\n const drawersNotActiveByDefault = globalDrawers.filter(drawer => !drawer.defaultActive);\n const hasDrawersOpenByUserAction = drawersNotActiveByDefault.find(drawer =>\n activeGlobalDrawersIdsRef.current.includes(drawer.id)\n );\n if (hasDrawersOpenByUserAction || activeGlobalDrawersIdsRef.current.length === DRAWERS_LIMIT) {\n return;\n }\n\n const defaultActiveGlobalDrawers = sortByPriority(globalDrawers).filter(\n drawer => !activeGlobalDrawersIdsRef.current.includes(drawer.id) && drawer.defaultActive\n );\n defaultActiveGlobalDrawers.forEach(drawer => {\n onGlobalDrawersChangeStable(drawer.id);\n });\n });\n return () => {\n unsubscribe();\n setRuntimeDrawers({ localBefore: [], localAfter: [], global: [] });\n };\n }, [disableRuntimeDrawers, onGlobalDrawersChangeStable, onLocalDrawerChangeStable]);\n\n useEffect(() => {\n const unsubscribe = awsuiPluginsInternal.appLayout.onDrawerOpened(drawerId => {\n const localDrawer = [...runtimeDrawers.localBefore, ...drawers, ...runtimeDrawers.localAfter]?.find(\n drawer => drawer.id === drawerId\n );\n const globalDrawer = runtimeDrawers.global?.find(drawer => drawer.id === drawerId);\n if (localDrawer && activeDrawerId !== drawerId) {\n onActiveDrawerChange(drawerId);\n }\n if (globalDrawer && !activeGlobalDrawersIds.includes(drawerId)) {\n onActiveGlobalDrawersChange(drawerId);\n }\n });\n\n return () => {\n unsubscribe();\n };\n }, [\n activeDrawerId,\n activeGlobalDrawersIds,\n drawers,\n onActiveDrawerChange,\n runtimeDrawers,\n onActiveGlobalDrawersChange,\n ]);\n\n useEffect(() => {\n const unsubscribe = awsuiPluginsInternal.appLayout.onDrawerClosed(drawerId => {\n const localDrawer = [...runtimeDrawers.localBefore, ...drawers, ...runtimeDrawers.localAfter]?.find(\n drawer => drawer.id === drawerId\n );\n const globalDrawer = runtimeDrawers.global?.find(drawer => drawer.id === drawerId);\n if (localDrawer && activeDrawerId === drawerId) {\n onActiveDrawerChange(null);\n }\n if (globalDrawer && activeGlobalDrawersIds.includes(drawerId)) {\n onActiveGlobalDrawersChange(drawerId);\n }\n });\n\n return () => {\n unsubscribe();\n };\n }, [\n activeDrawerId,\n activeGlobalDrawersIds,\n drawers,\n onActiveDrawerChange,\n runtimeDrawers,\n onActiveGlobalDrawersChange,\n ]);\n\n return runtimeDrawers;\n}\n\nfunction applyToolsDrawer(toolsProps: ToolsProps, runtimeDrawers: DrawersLayout) {\n const drawers = [...runtimeDrawers.localBefore, ...runtimeDrawers.localAfter];\n if (drawers.length === 0 && toolsProps.disableDrawersMerge) {\n return null;\n }\n const toolsItem = getToolsDrawerItem(toolsProps);\n if (toolsItem) {\n drawers.unshift(toolsItem);\n }\n\n return drawers;\n}\n\nexport const MIN_DRAWER_SIZE = 290;\n\ntype UseDrawersProps = Pick<AppLayoutProps, 'drawers' | 'activeDrawerId' | 'onDrawerChange'> & {\n __disableRuntimeDrawers?: boolean;\n onGlobalDrawerFocus?: (drawerId: string, open: boolean) => void;\n onAddNewActiveDrawer?: (drawerId: string) => void;\n};\n\nexport function useDrawers(\n {\n drawers,\n activeDrawerId: controlledActiveDrawerId,\n onDrawerChange,\n onGlobalDrawerFocus,\n onAddNewActiveDrawer,\n __disableRuntimeDrawers: disableRuntimeDrawers,\n }: UseDrawersProps,\n ariaLabels: AppLayoutProps['ariaLabels'],\n toolsProps: ToolsProps\n) {\n const [activeDrawerId = null, setActiveDrawerId] = useControllable(controlledActiveDrawerId, onDrawerChange, null, {\n componentName: 'AppLayout',\n controlledProp: 'activeDrawerId',\n changeHandler: 'onChange',\n });\n const [activeGlobalDrawersIds, setActiveGlobalDrawersIds] = useState<Array<string>>([]);\n const [drawerSizes, setDrawerSizes] = useState<Record<string, number>>({});\n // FIFO queue that keeps track of open drawers, where the first element is the most recently opened drawer\n const drawersOpenQueue = useRef<Array<string>>([]);\n\n function onActiveDrawerResize({ id, size }: { id: string; size: number }) {\n setDrawerSizes(oldSizes => ({ ...oldSizes, [id]: size }));\n fireNonCancelableEvent(activeDrawer?.onResize, { id, size });\n const activeGlobalDrawer = runtimeGlobalDrawers.find(drawer => drawer.id === id);\n fireNonCancelableEvent(activeGlobalDrawer?.onResize, { id, size });\n }\n\n function onActiveDrawerChange(newDrawerId: string | null) {\n setActiveDrawerId(newDrawerId);\n if (newDrawerId) {\n onAddNewActiveDrawer?.(newDrawerId);\n }\n if (hasOwnDrawers) {\n fireNonCancelableEvent(onDrawerChange, { activeDrawerId: newDrawerId });\n } else if (!toolsProps.toolsHide) {\n toolsProps.onToolsToggle(newDrawerId === TOOLS_DRAWER_ID);\n }\n\n if (newDrawerId) {\n drawersOpenQueue.current = [newDrawerId, ...drawersOpenQueue.current];\n }\n\n if (activeDrawerId) {\n drawersOpenQueue.current = drawersOpenQueue.current.filter(id => id !== activeDrawerId);\n }\n }\n\n function onActiveGlobalDrawersChange(drawerId: string) {\n if (activeGlobalDrawersIds.includes(drawerId)) {\n setActiveGlobalDrawersIds(currentState => currentState.filter(id => id !== drawerId));\n onGlobalDrawerFocus?.(drawerId, false);\n drawersOpenQueue.current = drawersOpenQueue.current.filter(id => id !== drawerId);\n } else if (drawerId) {\n onAddNewActiveDrawer?.(drawerId);\n setActiveGlobalDrawersIds(currentState => [drawerId, ...currentState].slice(0, DRAWERS_LIMIT!));\n onGlobalDrawerFocus?.(drawerId, true);\n drawersOpenQueue.current = [drawerId, ...drawersOpenQueue.current];\n }\n }\n\n const hasOwnDrawers = !!drawers;\n const runtimeDrawers = useRuntimeDrawers(\n disableRuntimeDrawers,\n activeDrawerId,\n onActiveDrawerChange,\n activeGlobalDrawersIds,\n onActiveGlobalDrawersChange,\n drawers ?? []\n );\n const { localBefore, localAfter, global: runtimeGlobalDrawers } = runtimeDrawers;\n const combinedLocalDrawers = drawers\n ? [...localBefore, ...drawers, ...localAfter]\n : applyToolsDrawer(toolsProps, runtimeDrawers);\n // support toolsOpen in runtime-drawers-only mode\n let activeDrawerIdResolved =\n toolsProps?.toolsOpen && !hasOwnDrawers\n ? TOOLS_DRAWER_ID\n : activeDrawerId !== TOOLS_DRAWER_ID\n ? activeDrawerId\n : null;\n const activeDrawer = combinedLocalDrawers?.find(drawer => drawer.id === activeDrawerIdResolved);\n // ensure that id is only defined when the drawer exists\n activeDrawerIdResolved = activeDrawer?.id ?? null;\n const activeGlobalDrawers = runtimeGlobalDrawers.filter(drawer => activeGlobalDrawersIds.includes(drawer.id));\n\n const activeDrawerSize = activeDrawerIdResolved\n ? drawerSizes[activeDrawerIdResolved] ?? activeDrawer?.defaultSize ?? toolsProps.toolsWidth\n : toolsProps.toolsWidth;\n const activeGlobalDrawersSizes: Record<string, number> = activeGlobalDrawersIds.reduce(\n (acc, currentGlobalDrawerId) => {\n const currentGlobalDrawer = runtimeGlobalDrawers.find(drawer => drawer.id === currentGlobalDrawerId);\n return {\n ...acc,\n [currentGlobalDrawerId]:\n drawerSizes[currentGlobalDrawerId] ?? currentGlobalDrawer?.defaultSize ?? MIN_DRAWER_SIZE,\n };\n },\n {}\n );\n const minGlobalDrawersSizes: Record<string, number> = runtimeGlobalDrawers.reduce((acc, globalDrawer) => {\n return {\n ...acc,\n [globalDrawer.id]: Math.min(globalDrawer.defaultSize ?? MIN_DRAWER_SIZE, MIN_DRAWER_SIZE),\n };\n }, {});\n const minDrawerSize = Math.min(\n toolsProps?.toolsOpen ? toolsProps.toolsWidth : activeDrawer?.defaultSize ?? MIN_DRAWER_SIZE,\n MIN_DRAWER_SIZE\n );\n\n return {\n ariaLabelsWithDrawers: ariaLabels,\n drawers: combinedLocalDrawers || undefined,\n activeDrawer,\n activeDrawerId: activeDrawerIdResolved,\n globalDrawers: runtimeGlobalDrawers,\n activeGlobalDrawers: activeGlobalDrawers,\n activeGlobalDrawersIds,\n activeGlobalDrawersSizes,\n activeDrawerSize,\n minDrawerSize,\n minGlobalDrawersSizes,\n drawerSizes,\n drawersOpenQueue: drawersOpenQueue.current,\n onActiveDrawerChange,\n onActiveDrawerResize,\n onActiveGlobalDrawersChange,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/file-upload/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAM9D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/file-upload/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAM9D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AASnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAQlF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;;AAQ/C,wBAAoD"}
|
package/file-upload/internal.js
CHANGED
|
@@ -9,6 +9,7 @@ import { useFormFieldContext } from '../contexts/form-field';
|
|
|
9
9
|
import { ConstraintText, FormFieldError, FormFieldWarning } from '../form-field/internal';
|
|
10
10
|
import { getBaseProps } from '../internal/base-component';
|
|
11
11
|
import InternalFileDropzone, { useFilesDragging } from '../internal/components/file-dropzone';
|
|
12
|
+
import InternalFileInput from '../internal/components/file-input';
|
|
12
13
|
import TokenList from '../internal/components/token-list';
|
|
13
14
|
import { fireNonCancelableEvent } from '../internal/events';
|
|
14
15
|
import checkControlled from '../internal/hooks/check-controlled';
|
|
@@ -18,10 +19,9 @@ import { useUniqueId } from '../internal/hooks/use-unique-id';
|
|
|
18
19
|
import { joinStrings } from '../internal/utils/strings';
|
|
19
20
|
import InternalSpaceBetween from '../space-between/internal';
|
|
20
21
|
import { Token } from '../token-group/token';
|
|
21
|
-
import FileInput from './file-input';
|
|
22
22
|
import { FileOption } from './file-option';
|
|
23
|
+
import fileInputStyles from '../internal/components/file-input/styles.css.js';
|
|
23
24
|
import tokenListStyles from '../internal/components/token-list/styles.css.js';
|
|
24
|
-
import fileInputStyles from './file-input/styles.css.js';
|
|
25
25
|
import styles from './styles.css.js';
|
|
26
26
|
export default React.forwardRef(InternalFileUpload);
|
|
27
27
|
function InternalFileUpload(_a, externalRef) {
|
|
@@ -36,7 +36,7 @@ function InternalFileUpload(_a, externalRef) {
|
|
|
36
36
|
},
|
|
37
37
|
listItemSelector: `.${tokenListStyles['list-item']}`,
|
|
38
38
|
showMoreSelector: `.${tokenListStyles.toggle}`,
|
|
39
|
-
fallbackSelector: `.${fileInputStyles['
|
|
39
|
+
fallbackSelector: `.${fileInputStyles['file-input']}`,
|
|
40
40
|
});
|
|
41
41
|
const baseProps = getBaseProps(restProps);
|
|
42
42
|
const metadata = { showFileSize, showFileLastModified, showFileThumbnail };
|
|
@@ -69,7 +69,7 @@ function InternalFileUpload(_a, externalRef) {
|
|
|
69
69
|
const invalid = restProps.invalid || formFieldContext.invalid || hasError;
|
|
70
70
|
return (React.createElement(InternalSpaceBetween, Object.assign({}, baseProps, { size: "xs", className: clsx(baseProps.className, styles.root), __internalRootRef: __internalRootRef, ref: tokenListRef }),
|
|
71
71
|
React.createElement(InternalBox, null,
|
|
72
|
-
areFilesDragging ? (React.createElement(InternalFileDropzone, { onChange: event => handleFilesChange(event.detail.value) }, i18nStrings.dropzoneText(multiple))) : (React.createElement(
|
|
72
|
+
areFilesDragging ? (React.createElement(InternalFileDropzone, { onChange: event => handleFilesChange(event.detail.value) }, i18nStrings.dropzoneText(multiple))) : (React.createElement(InternalFileInput, Object.assign({ ref: ref, accept: accept, ariaRequired: ariaRequired, multiple: multiple, onChange: event => handleFilesChange(event.detail.value), value: value }, restProps, { ariaDescribedby: ariaDescribedBy, invalid: invalid }), i18nStrings.uploadButtonText(multiple))),
|
|
73
73
|
(constraintText || errorText || warningText) && (React.createElement("div", { className: styles.hints },
|
|
74
74
|
errorText && (React.createElement(FormFieldError, { id: errorId, errorIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel }, errorText)),
|
|
75
75
|
showWarning && (React.createElement(FormFieldWarning, { id: warningId, warningIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.warningIconAriaLabel }, warningText)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/file-upload/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAgB,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,oBAAoB,EAAE,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,eAAe,MAAM,iDAAiD,CAAC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WAAW,GAAI,CACtE,CACI,CACf,CAAC,CAAC,CAAC,IAAI;QAEP,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC9B,oBAAC,WAAW;YACV,oBAAC,SAAS,IACR,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAC/B,oBAAC,KAAK,IACJ,SAAS,EAAE,IAAI,CAAC,IAAI,EACpB,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,EACxD,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,EACxC,SAAS,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,SAAS,CAAC,EAClC,WAAW,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,SAAS,CAAC,EACtC,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,EAClD,oBAAoB,EAAE,WAAW,CAAC,oBAAoB,gBAC1C,SAAS;oBAErB,oBAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAI,CAClE,CACT,EACD,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE;oBACX,cAAc,EAAE,WAAW,CAAC,cAAc;oBAC1C,aAAa,EAAE,WAAW,CAAC,aAAa;iBACzC,GACD,CACU,CACf,CAAC,CAAC,CAAC,IAAI,CACa,CACxB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { ForwardedRef, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { ConstraintText, FormFieldError, FormFieldWarning } from '../form-field/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalFileDropzone, { useFilesDragging } from '../internal/components/file-dropzone';\nimport TokenList from '../internal/components/token-list';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useListFocusController } from '../internal/hooks/use-list-focus-controller';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { joinStrings } from '../internal/utils/strings';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { Token } from '../token-group/token';\nimport FileInput from './file-input';\nimport { FileOption } from './file-option';\nimport { FileUploadProps } from './interfaces';\n\nimport tokenListStyles from '../internal/components/token-list/styles.css.js';\nimport fileInputStyles from './file-input/styles.css.js';\nimport styles from './styles.css.js';\n\ntype InternalFileUploadProps = FileUploadProps & InternalBaseComponentProps;\n\nexport default React.forwardRef(InternalFileUpload);\n\nfunction InternalFileUpload(\n {\n accept,\n ariaRequired,\n multiple = false,\n onChange,\n value,\n tokenLimit,\n showFileSize,\n showFileLastModified,\n showFileThumbnail,\n i18nStrings,\n __internalRootRef = null,\n constraintText,\n errorText,\n warningText,\n fileErrors,\n fileWarnings,\n ...restProps\n }: InternalFileUploadProps,\n externalRef: ForwardedRef<ButtonProps.Ref>\n) {\n const [nextFocusIndex, setNextFocusIndex] = useState<null | number>(null);\n const tokenListRef = useListFocusController({\n nextFocusIndex,\n onFocusMoved: target => {\n target.focus();\n setNextFocusIndex(null);\n },\n listItemSelector: `.${tokenListStyles['list-item']}`,\n showMoreSelector: `.${tokenListStyles.toggle}`,\n fallbackSelector: `.${fileInputStyles['upload-input']}`,\n });\n\n const baseProps = getBaseProps(restProps);\n const metadata = { showFileSize, showFileLastModified, showFileThumbnail };\n\n const errorId = useUniqueId('error-');\n const warningId = useUniqueId('warning-');\n const constraintTextId = useUniqueId('constraint-text-');\n\n const fileInputRef = useRef<ButtonProps.Ref>(null);\n const ref = useMergeRefs(fileInputRef, externalRef);\n\n checkControlled('FileUpload', 'value', value, 'onChange', onChange);\n\n if (!multiple && value.length > 1) {\n warnOnce('FileUpload', 'Value must be an array of size 0 or 1 when `multiple=false`.');\n }\n\n const handleFilesChange = (newFiles: File[]) => {\n const newValue = multiple ? [...value, ...newFiles] : newFiles[0] ? newFiles.slice(0, 1) : [...value];\n fireNonCancelableEvent(onChange, { value: newValue });\n };\n\n const onFileRemove = (removeFileIndex: number) => {\n const newValue = value.filter((_, fileIndex) => fileIndex !== removeFileIndex);\n fireNonCancelableEvent(onChange, { value: newValue });\n setNextFocusIndex(removeFileIndex);\n };\n\n const { areFilesDragging } = useFilesDragging();\n\n const showWarning = warningText && !errorText;\n\n if (warningText && errorText) {\n warnOnce('FileUpload', 'Both `errorText` and `warningText` exist. `warningText` will not be shown.');\n }\n\n const formFieldContext = useFormFieldContext(restProps);\n const ariaDescribedBy = joinStrings(\n restProps.ariaDescribedby ?? formFieldContext.ariaDescribedby,\n errorText ? errorId : undefined,\n showWarning ? warningId : undefined,\n constraintText ? constraintTextId : undefined\n );\n\n const hasError = Boolean(errorText || fileErrors?.filter(Boolean).length);\n const invalid = restProps.invalid || formFieldContext.invalid || hasError;\n\n return (\n <InternalSpaceBetween\n {...baseProps}\n size=\"xs\"\n className={clsx(baseProps.className, styles.root)}\n __internalRootRef={__internalRootRef}\n ref={tokenListRef}\n >\n <InternalBox>\n {areFilesDragging ? (\n <InternalFileDropzone onChange={event => handleFilesChange(event.detail.value)}>\n {i18nStrings.dropzoneText(multiple)}\n </InternalFileDropzone>\n ) : (\n <FileInput\n ref={ref}\n accept={accept}\n ariaRequired={ariaRequired}\n multiple={multiple}\n onChange={handleFilesChange}\n value={value}\n {...restProps}\n ariaDescribedby={ariaDescribedBy}\n invalid={invalid}\n >\n {i18nStrings.uploadButtonText(multiple)}\n </FileInput>\n )}\n\n {(constraintText || errorText || warningText) && (\n <div className={styles.hints}>\n {errorText && (\n <FormFieldError id={errorId} errorIconAriaLabel={i18nStrings?.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {showWarning && (\n <FormFieldWarning id={warningId} warningIconAriaLabel={i18nStrings?.warningIconAriaLabel}>\n {warningText}\n </FormFieldWarning>\n )}\n {constraintText && (\n <ConstraintText id={constraintTextId} hasValidationText={!!errorText || !!warningText}>\n {constraintText}\n </ConstraintText>\n )}\n </div>\n )}\n </InternalBox>\n\n {!multiple && value.length > 0 ? (\n <InternalBox>\n <Token\n ariaLabel={value[0].name}\n dismissLabel={i18nStrings.removeFileAriaLabel(0)}\n onDismiss={() => onFileRemove(0)}\n errorText={fileErrors?.[0]}\n warningText={fileWarnings?.[0]}\n errorIconAriaLabel={i18nStrings.errorIconAriaLabel}\n warningIconAriaLabel={i18nStrings.warningIconAriaLabel}\n data-index={0}\n >\n <FileOption file={value[0]} metadata={metadata} i18nStrings={i18nStrings} />\n </Token>\n </InternalBox>\n ) : null}\n\n {multiple && value.length > 0 ? (\n <InternalBox>\n <TokenList\n alignment=\"vertical\"\n items={value}\n renderItem={(file, fileIndex) => (\n <Token\n ariaLabel={file.name}\n dismissLabel={i18nStrings.removeFileAriaLabel(fileIndex)}\n onDismiss={() => onFileRemove(fileIndex)}\n errorText={fileErrors?.[fileIndex]}\n warningText={fileWarnings?.[fileIndex]}\n errorIconAriaLabel={i18nStrings.errorIconAriaLabel}\n warningIconAriaLabel={i18nStrings.warningIconAriaLabel}\n data-index={fileIndex}\n >\n <FileOption file={file} metadata={metadata} i18nStrings={i18nStrings} />\n </Token>\n )}\n limit={tokenLimit}\n i18nStrings={{\n limitShowFewer: i18nStrings.limitShowFewer,\n limitShowMore: i18nStrings.limitShowMore,\n }}\n />\n </InternalBox>\n ) : null}\n </InternalSpaceBetween>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/file-upload/internal.tsx"],"names":[],"mappings":"AAAA,qEAA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B,oBAAC,WAAW;YACV,oBAAC,SAAS,IACR,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAC/B,oBAAC,KAAK,IACJ,SAAS,EAAE,IAAI,CAAC,IAAI,EACpB,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,EACxD,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,EACxC,SAAS,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,SAAS,CAAC,EAClC,WAAW,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,SAAS,CAAC,EACtC,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,EAClD,oBAAoB,EAAE,WAAW,CAAC,oBAAoB,gBAC1C,SAAS;oBAErB,oBAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAI,CAClE,CACT,EACD,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE;oBACX,cAAc,EAAE,WAAW,CAAC,cAAc;oBAC1C,aAAa,EAAE,WAAW,CAAC,aAAa;iBACzC,GACD,CACU,CACf,CAAC,CAAC,CAAC,IAAI,CACa,CACxB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { ForwardedRef, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { ConstraintText, FormFieldError, FormFieldWarning } from '../form-field/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalFileDropzone, { useFilesDragging } from '../internal/components/file-dropzone';\nimport InternalFileInput from '../internal/components/file-input';\nimport TokenList from '../internal/components/token-list';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useListFocusController } from '../internal/hooks/use-list-focus-controller';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { joinStrings } from '../internal/utils/strings';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { Token } from '../token-group/token';\nimport { FileOption } from './file-option';\nimport { FileUploadProps } from './interfaces';\n\nimport fileInputStyles from '../internal/components/file-input/styles.css.js';\nimport tokenListStyles from '../internal/components/token-list/styles.css.js';\nimport styles from './styles.css.js';\n\ntype InternalFileUploadProps = FileUploadProps & InternalBaseComponentProps;\n\nexport default React.forwardRef(InternalFileUpload);\n\nfunction InternalFileUpload(\n {\n accept,\n ariaRequired,\n multiple = false,\n onChange,\n value,\n tokenLimit,\n showFileSize,\n showFileLastModified,\n showFileThumbnail,\n i18nStrings,\n __internalRootRef = null,\n constraintText,\n errorText,\n warningText,\n fileErrors,\n fileWarnings,\n ...restProps\n }: InternalFileUploadProps,\n externalRef: ForwardedRef<ButtonProps.Ref>\n) {\n const [nextFocusIndex, setNextFocusIndex] = useState<null | number>(null);\n const tokenListRef = useListFocusController({\n nextFocusIndex,\n onFocusMoved: target => {\n target.focus();\n setNextFocusIndex(null);\n },\n listItemSelector: `.${tokenListStyles['list-item']}`,\n showMoreSelector: `.${tokenListStyles.toggle}`,\n fallbackSelector: `.${fileInputStyles['file-input']}`,\n });\n\n const baseProps = getBaseProps(restProps);\n const metadata = { showFileSize, showFileLastModified, showFileThumbnail };\n\n const errorId = useUniqueId('error-');\n const warningId = useUniqueId('warning-');\n const constraintTextId = useUniqueId('constraint-text-');\n\n const fileInputRef = useRef<ButtonProps.Ref>(null);\n const ref = useMergeRefs(fileInputRef, externalRef);\n\n checkControlled('FileUpload', 'value', value, 'onChange', onChange);\n\n if (!multiple && value.length > 1) {\n warnOnce('FileUpload', 'Value must be an array of size 0 or 1 when `multiple=false`.');\n }\n\n const handleFilesChange = (newFiles: File[]) => {\n const newValue = multiple ? [...value, ...newFiles] : newFiles[0] ? newFiles.slice(0, 1) : [...value];\n fireNonCancelableEvent(onChange, { value: newValue });\n };\n\n const onFileRemove = (removeFileIndex: number) => {\n const newValue = value.filter((_, fileIndex) => fileIndex !== removeFileIndex);\n fireNonCancelableEvent(onChange, { value: newValue });\n setNextFocusIndex(removeFileIndex);\n };\n\n const { areFilesDragging } = useFilesDragging();\n\n const showWarning = warningText && !errorText;\n\n if (warningText && errorText) {\n warnOnce('FileUpload', 'Both `errorText` and `warningText` exist. `warningText` will not be shown.');\n }\n\n const formFieldContext = useFormFieldContext(restProps);\n const ariaDescribedBy = joinStrings(\n restProps.ariaDescribedby ?? formFieldContext.ariaDescribedby,\n errorText ? errorId : undefined,\n showWarning ? warningId : undefined,\n constraintText ? constraintTextId : undefined\n );\n\n const hasError = Boolean(errorText || fileErrors?.filter(Boolean).length);\n const invalid = restProps.invalid || formFieldContext.invalid || hasError;\n\n return (\n <InternalSpaceBetween\n {...baseProps}\n size=\"xs\"\n className={clsx(baseProps.className, styles.root)}\n __internalRootRef={__internalRootRef}\n ref={tokenListRef}\n >\n <InternalBox>\n {areFilesDragging ? (\n <InternalFileDropzone onChange={event => handleFilesChange(event.detail.value)}>\n {i18nStrings.dropzoneText(multiple)}\n </InternalFileDropzone>\n ) : (\n <InternalFileInput\n ref={ref}\n accept={accept}\n ariaRequired={ariaRequired}\n multiple={multiple}\n onChange={event => handleFilesChange(event.detail.value)}\n value={value}\n {...restProps}\n ariaDescribedby={ariaDescribedBy}\n invalid={invalid}\n >\n {i18nStrings.uploadButtonText(multiple)}\n </InternalFileInput>\n )}\n\n {(constraintText || errorText || warningText) && (\n <div className={styles.hints}>\n {errorText && (\n <FormFieldError id={errorId} errorIconAriaLabel={i18nStrings?.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {showWarning && (\n <FormFieldWarning id={warningId} warningIconAriaLabel={i18nStrings?.warningIconAriaLabel}>\n {warningText}\n </FormFieldWarning>\n )}\n {constraintText && (\n <ConstraintText id={constraintTextId} hasValidationText={!!errorText || !!warningText}>\n {constraintText}\n </ConstraintText>\n )}\n </div>\n )}\n </InternalBox>\n\n {!multiple && value.length > 0 ? (\n <InternalBox>\n <Token\n ariaLabel={value[0].name}\n dismissLabel={i18nStrings.removeFileAriaLabel(0)}\n onDismiss={() => onFileRemove(0)}\n errorText={fileErrors?.[0]}\n warningText={fileWarnings?.[0]}\n errorIconAriaLabel={i18nStrings.errorIconAriaLabel}\n warningIconAriaLabel={i18nStrings.warningIconAriaLabel}\n data-index={0}\n >\n <FileOption file={value[0]} metadata={metadata} i18nStrings={i18nStrings} />\n </Token>\n </InternalBox>\n ) : null}\n\n {multiple && value.length > 0 ? (\n <InternalBox>\n <TokenList\n alignment=\"vertical\"\n items={value}\n renderItem={(file, fileIndex) => (\n <Token\n ariaLabel={file.name}\n dismissLabel={i18nStrings.removeFileAriaLabel(fileIndex)}\n onDismiss={() => onFileRemove(fileIndex)}\n errorText={fileErrors?.[fileIndex]}\n warningText={fileWarnings?.[fileIndex]}\n errorIconAriaLabel={i18nStrings.errorIconAriaLabel}\n warningIconAriaLabel={i18nStrings.warningIconAriaLabel}\n data-index={fileIndex}\n >\n <FileOption file={file} metadata={metadata} i18nStrings={i18nStrings} />\n </Token>\n )}\n limit={tokenLimit}\n i18nStrings={{\n limitShowFewer: i18nStrings.limitShowFewer,\n limitShowMore: i18nStrings.limitShowMore,\n }}\n />\n </InternalBox>\n ) : null}\n </InternalSpaceBetween>\n );\n}\n"]}
|
|
@@ -13,6 +13,7 @@ declare const icons: {
|
|
|
13
13
|
"audio-full": JSX.Element;
|
|
14
14
|
"audio-half": JSX.Element;
|
|
15
15
|
"audio-off": JSX.Element;
|
|
16
|
+
"backward-10-seconds": JSX.Element;
|
|
16
17
|
bug: JSX.Element;
|
|
17
18
|
calendar: JSX.Element;
|
|
18
19
|
call: JSX.Element;
|
|
@@ -24,6 +25,9 @@ declare const icons: {
|
|
|
24
25
|
"caret-up": JSX.Element;
|
|
25
26
|
check: JSX.Element;
|
|
26
27
|
close: JSX.Element;
|
|
28
|
+
"closed-caption-unavailable": JSX.Element;
|
|
29
|
+
"closed-caption": JSX.Element;
|
|
30
|
+
"command-prompt": JSX.Element;
|
|
27
31
|
contact: JSX.Element;
|
|
28
32
|
copy: JSX.Element;
|
|
29
33
|
"delete-marker": JSX.Element;
|
|
@@ -32,15 +36,26 @@ declare const icons: {
|
|
|
32
36
|
edit: JSX.Element;
|
|
33
37
|
ellipsis: JSX.Element;
|
|
34
38
|
envelope: JSX.Element;
|
|
39
|
+
"exit-full-screen": JSX.Element;
|
|
35
40
|
expand: JSX.Element;
|
|
36
41
|
external: JSX.Element;
|
|
42
|
+
"face-happy-filled": JSX.Element;
|
|
43
|
+
"face-happy": JSX.Element;
|
|
44
|
+
"face-neutral-filled": JSX.Element;
|
|
45
|
+
"face-neutral": JSX.Element;
|
|
46
|
+
"face-sad-filled": JSX.Element;
|
|
47
|
+
"face-sad": JSX.Element;
|
|
37
48
|
"file-open": JSX.Element;
|
|
38
49
|
file: JSX.Element;
|
|
39
50
|
filter: JSX.Element;
|
|
40
51
|
flag: JSX.Element;
|
|
41
52
|
"folder-open": JSX.Element;
|
|
42
53
|
folder: JSX.Element;
|
|
54
|
+
"forward-10-seconds": JSX.Element;
|
|
55
|
+
"full-screen": JSX.Element;
|
|
43
56
|
"gen-ai": JSX.Element;
|
|
57
|
+
globe: JSX.Element;
|
|
58
|
+
"grid-view": JSX.Element;
|
|
44
59
|
"group-active": JSX.Element;
|
|
45
60
|
group: JSX.Element;
|
|
46
61
|
"heart-filled": JSX.Element;
|
|
@@ -48,12 +63,18 @@ declare const icons: {
|
|
|
48
63
|
"insert-row": JSX.Element;
|
|
49
64
|
key: JSX.Element;
|
|
50
65
|
keyboard: JSX.Element;
|
|
66
|
+
"list-view": JSX.Element;
|
|
67
|
+
"location-pin": JSX.Element;
|
|
51
68
|
"lock-private": JSX.Element;
|
|
69
|
+
map: JSX.Element;
|
|
52
70
|
menu: JSX.Element;
|
|
53
71
|
"microphone-off": JSX.Element;
|
|
54
72
|
microphone: JSX.Element;
|
|
73
|
+
"mini-player": JSX.Element;
|
|
55
74
|
multiscreen: JSX.Element;
|
|
56
75
|
notification: JSX.Element;
|
|
76
|
+
pause: JSX.Element;
|
|
77
|
+
play: JSX.Element;
|
|
57
78
|
redo: JSX.Element;
|
|
58
79
|
refresh: JSX.Element;
|
|
59
80
|
remove: JSX.Element;
|
|
@@ -77,11 +98,13 @@ declare const icons: {
|
|
|
77
98
|
"status-warning": JSX.Element;
|
|
78
99
|
"subtract-minus": JSX.Element;
|
|
79
100
|
suggestions: JSX.Element;
|
|
101
|
+
support: JSX.Element;
|
|
80
102
|
"thumbs-down-filled": JSX.Element;
|
|
81
103
|
"thumbs-down": JSX.Element;
|
|
82
104
|
"thumbs-up-filled": JSX.Element;
|
|
83
105
|
"thumbs-up": JSX.Element;
|
|
84
106
|
ticket: JSX.Element;
|
|
107
|
+
transcript: JSX.Element;
|
|
85
108
|
"treeview-collapse": JSX.Element;
|
|
86
109
|
"treeview-expand": JSX.Element;
|
|
87
110
|
undo: JSX.Element;
|
|
@@ -90,6 +113,9 @@ declare const icons: {
|
|
|
90
113
|
upload: JSX.Element;
|
|
91
114
|
"user-profile-active": JSX.Element;
|
|
92
115
|
"user-profile": JSX.Element;
|
|
116
|
+
"video-camera-off": JSX.Element;
|
|
117
|
+
"video-camera-on": JSX.Element;
|
|
118
|
+
"video-camera-unavailable": JSX.Element;
|
|
93
119
|
"video-off": JSX.Element;
|
|
94
120
|
"video-on": JSX.Element;
|
|
95
121
|
"video-unavailable": JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../src/icon/generated/icons.tsx"],"names":[],"mappings":";AACE,QAAA,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../src/icon/generated/icons.tsx"],"names":[],"mappings":";AACE,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8HV,CAAC;AACF,eAAe,KAAK,CAAC"}
|
package/icon/generated/icons.js
CHANGED
|
@@ -31,6 +31,11 @@ const icons = {
|
|
|
31
31
|
React.createElement("path", { d: "M11 9.71c1.1 0 2-.9 2-2s-.9-2-2-2" })),
|
|
32
32
|
"audio-off": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
33
33
|
React.createElement("path", { d: "M6.47 13.41 4 10.7H1v-6h3l2.47-2.71C7.01 1.4 8 1.78 8 2.58v10.23c0 .8-.99 1.19-1.53.59v.01ZM11 5.71l3.99 4M15 5.71 11 9.7", className: "stroke-linejoin-round" })),
|
|
34
|
+
"backward-10-seconds": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
35
|
+
React.createElement("path", { d: "M5.95 14.01h-.96c-.56 0-1.02-.46-1.02-1.02v-2.96c0-.56.45-1.01 1.01-1.02h.96c.56 0 1.02.45 1.02 1.02v2.96c0 .56-.46 1.02-1.02 1.02h.01Z", className: "stroke-linejoin-round" }),
|
|
36
|
+
React.createElement("path", { d: "M1 9v5", className: "stroke-linecap-square" }),
|
|
37
|
+
React.createElement("path", { d: "M1 0v5h5", className: "stroke-linejoin-round" }),
|
|
38
|
+
React.createElement("path", { d: "M9.976 15A7.154 7.154 0 0 0 15 8.164C15 4.204 11.804 1 7.852 1A7.148 7.148 0 0 0 1.5 4.875", className: "stroke-linejoin-round" })),
|
|
34
39
|
"bug": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
35
40
|
React.createElement("path", { d: "M12 5.71a4 4 0 0 0-8 0v4a4 4 0 1 0 8 0v-4ZM15 8.71h-3M4 8.71H1M12 6H4M15 3.63l-3 2.08M15 13.78l-3-2.07M1 3.63l3 2.08M1 13.78l3-2.07" })),
|
|
36
41
|
"calendar": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
@@ -54,6 +59,15 @@ const icons = {
|
|
|
54
59
|
React.createElement("path", { d: "m1 9 4 4L15 2", className: "stroke-linejoin-round" })),
|
|
55
60
|
"close": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
56
61
|
React.createElement("path", { d: "m2 1.71 12 12M2 13.71l12-12", className: "stroke-linejoin-round" })),
|
|
62
|
+
"closed-caption-unavailable": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
63
|
+
React.createElement("path", { d: "M15 1H1v14h14V1Z", className: "stroke-linejoin-round" }),
|
|
64
|
+
React.createElement("path", { d: "M7.51 10H5c-.55 0-.99-.44-.99-.99V7c0-.55.44-.99.99-.99h1.01M13 10h-2.51c-.55 0-.99-.44-.99-.99V7c0-.55.44-.99.99-.99H13M1 1l14 14", className: "stroke-linejoin-round" })),
|
|
65
|
+
"closed-caption": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
66
|
+
React.createElement("path", { d: "M15 1H1v14h14V1Z", className: "stroke-linejoin-round" }),
|
|
67
|
+
React.createElement("path", { d: "M7.51 10H5c-.55 0-.99-.44-.99-.99V7c0-.55.44-.99.99-.99h2.51M13 10h-2.51c-.55 0-.99-.44-.99-.99V7c0-.55.44-.99.99-.99H13", className: "stroke-linejoin-round" })),
|
|
68
|
+
"command-prompt": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
69
|
+
React.createElement("path", { d: "M15 1H1v14h14V1ZM12 11H9", className: "stroke-linejoin-round" }),
|
|
70
|
+
React.createElement("path", { d: "M4.71 11.3 8 8 4.71 4.71", className: "stroke-linejoin-round" })),
|
|
57
71
|
"contact": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
58
72
|
React.createElement("path", { d: "M14 12c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h4v3l4-3h4Z", className: "stroke-linejoin-round" })),
|
|
59
73
|
"copy": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
@@ -80,10 +94,33 @@ const icons = {
|
|
|
80
94
|
"envelope": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
81
95
|
React.createElement("path", { d: "m1 3 7 6 7-6", className: "stroke-linejoin-round" }),
|
|
82
96
|
React.createElement("path", { d: "M15 3H1v10h14V3Z", className: "stroke-linejoin-round" })),
|
|
97
|
+
"exit-full-screen": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
98
|
+
React.createElement("path", { d: "M1 10.01h5V15M10 15v-5h5M6 1v5H1M15 6h-5V1", className: "stroke-linejoin-round" })),
|
|
83
99
|
"expand": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
84
100
|
React.createElement("path", { d: "M2 7V2h5M9 2h5v5M14 9v5H9M7 14H2V9M14 2 2 14M14 14 2.03 2.02", className: "stroke-linejoin-round" })),
|
|
85
101
|
"external": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
86
102
|
React.createElement("path", { d: "M14 8.01v-6H8M14.02 2 8 8.01M6 2.01H2v12h12v-3.99", className: "stroke-linejoin-round" })),
|
|
103
|
+
"face-happy-filled": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
104
|
+
React.createElement("path", { d: "M7.995 1.103a6.887 6.887 0 0 0-6.892 6.892 6.887 6.887 0 0 0 6.892 6.892 6.887 6.887 0 0 0 6.892-6.892 6.887 6.887 0 0 0-6.892-6.892Zm-2.002 7.61A2.148 2.148 0 0 0 8 10.134c.914 0 1.706-.592 2.007-1.423l1.646.596c-.54 1.489-1.966 2.577-3.653 2.577-1.686 0-3.114-1.088-3.653-2.577l1.646-.596ZM7.148 6.03a1.125 1.125 0 1 1-2.25 0 1.125 1.125 0 0 1 2.25 0Zm3.95 0a1.125 1.125 0 1 1-2.25 0 1.125 1.125 0 0 1 2.25 0Z", className: "filled no-stroke" }),
|
|
105
|
+
React.createElement("path", { d: "M8 .5A7.495 7.495 0 0 0 .5 8c0 4.146 3.354 7.5 7.5 7.5s7.5-3.354 7.5-7.5S12.146.5 8 .5Zm0 1.559c3.61 0 6.008 2.566 6.008 5.941 0 2.404-2.044 6.014-6.008 6.014-3.818 0-6.01-2.9-6.01-6.014 0-2.603 1.712-5.941 6.01-5.941Z", className: "filled no-stroke" })),
|
|
106
|
+
"face-happy": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
107
|
+
React.createElement("circle", { cx: "8", cy: "8", r: "7" }),
|
|
108
|
+
React.createElement("path", { d: "M6 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM10.01 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z", className: "filled no-stroke" }),
|
|
109
|
+
React.createElement("path", { d: "M10.83 9.01c-.42 1.16-1.53 2-2.83 2s-2.41-.84-2.83-2", className: "stroke-linejoin-round" })),
|
|
110
|
+
"face-neutral-filled": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
111
|
+
React.createElement("path", { d: "M7.995 1.103a6.887 6.887 0 0 0-6.892 6.892 6.887 6.887 0 0 0 6.892 6.892 6.887 6.887 0 0 0 6.892-6.892 6.887 6.887 0 0 0-6.892-6.892ZM11 10.875H5v-1.75h6v1.75ZM7.148 6.03a1.125 1.125 0 1 1-2.25 0 1.125 1.125 0 0 1 2.25 0Zm3.95 0a1.125 1.125 0 1 1-2.25 0 1.125 1.125 0 0 1 2.25 0Z", className: "filled no-stroke" }),
|
|
112
|
+
React.createElement("path", { d: "M8 .5A7.495 7.495 0 0 0 .5 8c0 4.146 3.354 7.5 7.5 7.5s7.5-3.354 7.5-7.5S12.146.5 8 .5Zm0 1.559c3.61 0 6.008 2.566 6.008 5.941 0 2.404-2.044 6.014-6.008 6.014-3.818 0-6.01-2.9-6.01-6.014 0-2.603 1.712-5.941 6.01-5.941Z", className: "filled no-stroke" })),
|
|
113
|
+
"face-neutral": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
114
|
+
React.createElement("circle", { cx: "8", cy: "8", r: "7" }),
|
|
115
|
+
React.createElement("path", { d: "M6 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM10.01 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z", className: "filled no-stroke" }),
|
|
116
|
+
React.createElement("path", { d: "M5 10h6", className: "stroke-linejoin-round" })),
|
|
117
|
+
"face-sad-filled": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
118
|
+
React.createElement("path", { d: "M7.995 1.103a6.887 6.887 0 0 0-6.892 6.892 6.887 6.887 0 0 0 6.892 6.892 6.887 6.887 0 0 0 6.892-6.892 6.887 6.887 0 0 0-6.892-6.892Zm-3.648 9.6C4.887 9.212 6.314 8.124 8 8.124c1.687 0 3.114 1.088 3.653 2.577l-1.646.596A2.148 2.148 0 0 0 8 9.875c-.913 0-1.706.592-2.007 1.423l-1.646-.596ZM7.148 6.03a1.125 1.125 0 1 1-2.25 0 1.125 1.125 0 0 1 2.25 0Zm3.95 0a1.125 1.125 0 1 1-2.25 0 1.125 1.125 0 0 1 2.25 0Z", className: "filled no-stroke" }),
|
|
119
|
+
React.createElement("path", { d: "M8 .5A7.495 7.495 0 0 0 .5 8c0 4.146 3.354 7.5 7.5 7.5s7.5-3.354 7.5-7.5S12.146.5 8 .5Zm0 1.559c3.61 0 6.008 2.566 6.008 5.941 0 2.404-2.044 6.014-6.008 6.014-3.818 0-6.01-2.9-6.01-6.014 0-2.603 1.712-5.941 6.01-5.941Z", className: "filled no-stroke" })),
|
|
120
|
+
"face-sad": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
121
|
+
React.createElement("circle", { cx: "8", cy: "8", r: "7" }),
|
|
122
|
+
React.createElement("path", { d: "M6 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM10.01 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z", className: "filled no-stroke" }),
|
|
123
|
+
React.createElement("path", { d: "M10.83 11C10.41 9.84 9.3 9 8 9s-2.41.84-2.83 2", className: "stroke-linejoin-round" })),
|
|
87
124
|
"file-open": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
88
125
|
React.createElement("path", { d: "M13 15H3V1h6l4 4v10Z", className: "stroke-linejoin-round" }),
|
|
89
126
|
React.createElement("path", { d: "M8 1v5h5M3 8l7 7", className: "stroke-linejoin-round" })),
|
|
@@ -99,9 +136,21 @@ const icons = {
|
|
|
99
136
|
React.createElement("path", { d: "M2 7V2h6l1 2h5c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1h-1", className: "stroke-linejoin-round" })),
|
|
100
137
|
"folder": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
101
138
|
React.createElement("path", { d: "M15 5v9H2V2h6l1 2h5c.55 0 1 .45 1 1Z", className: "stroke-linejoin-round" })),
|
|
139
|
+
"forward-10-seconds": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
140
|
+
React.createElement("path", { d: "M13.95 14.01h-.96c-.56 0-1.02-.46-1.02-1.02v-2.96c0-.56.45-1.01 1.01-1.02h.96c.56 0 1.02.45 1.02 1.02v2.96c0 .56-.46 1.02-1.02 1.02h.01Z", className: "stroke-linejoin-round" }),
|
|
141
|
+
React.createElement("path", { d: "M9 9v5", className: "stroke-linecap-square" }),
|
|
142
|
+
React.createElement("path", { d: "M15 0v5h-5", className: "stroke-linejoin-round" }),
|
|
143
|
+
React.createElement("path", { d: "M6.024 15A7.154 7.154 0 0 1 1 8.164C1 4.204 4.196 1 8.148 1A7.148 7.148 0 0 1 14.5 4.875", className: "stroke-linejoin-round" })),
|
|
144
|
+
"full-screen": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
145
|
+
React.createElement("path", { d: "M6 15H1v-5M15 10v5h-5M1 6V1h5M10 1h5v5", className: "stroke-linejoin-round" })),
|
|
102
146
|
"gen-ai": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
103
147
|
React.createElement("path", { d: "M6.15 10.365 8 15.005l1.86-4.64 4.64-1.86-4.64-1.85L8 2.005l-1.85 4.65-4.65 1.85 4.65 1.86Z", className: "stroke-linejoin-round" }),
|
|
104
148
|
React.createElement("path", { d: "M2.38 4.915c.02.05.07.08.12.08.05 0 .12-.08.12-.08l.66-1.64 1.64-.66a.13.13 0 0 0 .08-.12c0-.05-.08-.12-.08-.12l-1.64-.66-.66-1.64c-.04-.1-.2-.1-.24 0l-.66 1.64-1.64.66a.13.13 0 0 0-.08.12c0 .05.08.12.08.12l1.64.66.66 1.64Z", className: "filled no-stroke" })),
|
|
149
|
+
"globe": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
150
|
+
React.createElement("circle", { cx: "8", cy: "8", r: "7" }),
|
|
151
|
+
React.createElement("path", { d: "M8 15c1.657 0 3-3.134 3-7S9.657 1 8 1 5 4.134 5 8s1.343 7 3 7ZM1 8h14", className: "stroke-linejoin-round" })),
|
|
152
|
+
"grid-view": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
153
|
+
React.createElement("path", { d: "M6 10H2v4h4v-4ZM14 10h-4v4h4v-4ZM6 2H2v4h4V2ZM14 2h-4v4h4V2Z", className: "stroke-linejoin-round" })),
|
|
105
154
|
"group-active": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
106
155
|
React.createElement("circle", { cx: "11", cy: "7", r: "3", className: "filled no-stroke" }),
|
|
107
156
|
React.createElement("circle", { cx: "4.25", cy: "4.25", r: "2.75", className: "filled no-stroke" }),
|
|
@@ -123,8 +172,16 @@ const icons = {
|
|
|
123
172
|
React.createElement("path", { d: "M10.5 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z", className: "filled no-stroke" })),
|
|
124
173
|
"keyboard": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
125
174
|
React.createElement("path", { d: "M15 2H1v12h14V2ZM4 11h8M4 8h2M4 5h2M7 8h2M7 5h2M10 8h2M10 5h2" })),
|
|
175
|
+
"list-view": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
176
|
+
React.createElement("path", { d: "M5 3h10M5 8h10M5 13h10" }),
|
|
177
|
+
React.createElement("path", { d: "M2.01 3.01H2V3h.01v.01ZM2.01 8.01H2V8h.01v.01ZM2.01 13.01H2V13h.01v.01Z", className: "filled" })),
|
|
178
|
+
"location-pin": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
179
|
+
React.createElement("path", { d: "M8 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z", className: "stroke-linejoin-round" }),
|
|
180
|
+
React.createElement("path", { d: "M12.01 9c.63-.83 1-1.87 1-3 0-2.76-2.24-5-5-5a5.002 5.002 0 0 0-4 8l4 6 4-6Z", className: "stroke-linejoin-round" })),
|
|
126
181
|
"lock-private": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
127
182
|
React.createElement("path", { d: "M12 7H4a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1ZM5 7V4c0-1.65 1.35-3 3-3s3 1.35 3 3v3", className: "stroke-linejoin-round" })),
|
|
183
|
+
"map": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
184
|
+
React.createElement("path", { d: "M2 12.8V2l3.61 1.21V14L2 12.8ZM10.4 12.8V2L14 3.05V14l-3.6-1.2ZM5.61 14l4.79-1.2M5.61 3.21 10.4 2", className: "stroke-linejoin-round" })),
|
|
128
185
|
"menu": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
129
186
|
React.createElement("path", { d: "M15 3H1M15 8H1M15 13H1", className: "stroke-linejoin-round" })),
|
|
130
187
|
"microphone-off": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
@@ -136,11 +193,18 @@ const icons = {
|
|
|
136
193
|
"microphone": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
137
194
|
React.createElement("path", { d: "M3 15h10M8 15v-3M10 3a2 2 0 1 0-4 0v4a2 2 0 1 0 4 0V3Z", className: "stroke-linejoin-round" }),
|
|
138
195
|
React.createElement("path", { d: "M13 7c0 2.76-2.24 5-5 5S3 9.76 3 7", className: "stroke-linejoin-round" })),
|
|
196
|
+
"mini-player": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
197
|
+
React.createElement("path", { d: "M14 10.01H8v4h6v-4Z", className: "stroke-linejoin-round" }),
|
|
198
|
+
React.createElement("path", { d: "M5 14H2V2h12v5", className: "stroke-linejoin-round" })),
|
|
139
199
|
"multiscreen": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
140
200
|
React.createElement("path", { d: "M15 5H5v7h10V5Z", className: "stroke-linejoin-round" }),
|
|
141
201
|
React.createElement("path", { d: "M11 3V1.01L1.01 1 1 8h1.998M10 12v3M7 15h6", className: "stroke-linejoin-round" })),
|
|
142
202
|
"notification": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
143
203
|
React.createElement("path", { d: "M14 12H2c-.39 0-.63-.44-.41-.76L4 8V5c0-2.21 1.79-4 4-4s4 1.79 4 4v3l2.41 3.24c.22.33-.02.76-.41.76ZM6 13c0 1.1.9 2 2 2s2-.9 2-2", className: "stroke-linejoin-round" })),
|
|
204
|
+
"pause": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
205
|
+
React.createElement("path", { d: "M5 2v12M11 2v12", className: "stroke-linejoin-round" })),
|
|
206
|
+
"play": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
207
|
+
React.createElement("path", { d: "m4 13.03 8-5-8-5v10Z", className: "stroke-linejoin-round filled" })),
|
|
144
208
|
"redo": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
145
209
|
React.createElement("path", { d: "m11 2 4 4-4 4", className: "stroke-linejoin-round" }),
|
|
146
210
|
React.createElement("path", { d: "M14 6H5.5C3.01 6 1 8.01 1 10.5S3.01 15 5.5 15H8", className: "stroke-linejoin-round" })),
|
|
@@ -199,6 +263,10 @@ const icons = {
|
|
|
199
263
|
React.createElement("path", { d: "M2 8h12", className: "stroke-linejoin-round" })),
|
|
200
264
|
"suggestions": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
201
265
|
React.createElement("path", { d: "M8.12 15h-2l-.99-5.02C3.92 9.07 3.12 7.63 3.12 6c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.07-2.01 3.98L10.12 15h-2ZM11.12 12h-6", className: "stroke-linejoin-round" })),
|
|
266
|
+
"support": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
267
|
+
React.createElement("circle", { cx: "8", cy: "8", r: "7" }),
|
|
268
|
+
React.createElement("path", { d: "M5.75 6.338c.13-1.178.811-2.339 2.37-2.339 1.472 0 2.435 1.312 2.042 2.468-.215.633-.916 1.132-1.385 1.578C8.162 8.631 8 9.2 8 10" }),
|
|
269
|
+
React.createElement("path", { d: "M8 12.01h.01V12H8v.01Z", className: "filled" })),
|
|
202
270
|
"thumbs-down-filled": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
203
271
|
React.createElement("path", { d: "M1 1h2.01v9H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1Zm14.14 6.22-1.69-5.03C13.21 1.48 12.54 1 11.79 1H4.01v9l3.23 3.88c.6.72 1.77.29 1.77-.64V9h4.86c.92 0 1.57-.91 1.28-1.78h-.01Z", className: "filled no-stroke" })),
|
|
204
272
|
"thumbs-down": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
@@ -209,6 +277,8 @@ const icons = {
|
|
|
209
277
|
React.createElement("path", { d: "M9 2.871v4.13h4.12c.6 0 1.02.59.83 1.16l-1.6 4.77a1.58 1.58 0 0 1-1.49 1.07H1v-8h4l2.41-3.61c.48-.72 1.59-.38 1.59.48ZM5 14.001v-8", className: "stroke-linejoin-round" })),
|
|
210
278
|
"ticket": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
211
279
|
React.createElement("path", { d: "M13 8c0-1.1.9-2 2-2V3H1v3c1.1 0 2 .9 2 2s-.9 2-2 2v3h14v-3c-1.1 0-2-.9-2-2Z", className: "stroke-linejoin-round" })),
|
|
280
|
+
"transcript": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
281
|
+
React.createElement("path", { d: "M15 1H1v14h14V1ZM9 10H4M12 6H4", className: "stroke-linejoin-round" })),
|
|
212
282
|
"treeview-collapse": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
213
283
|
React.createElement("path", { d: "M14 2H2v12h12V2ZM5 8h6", className: "stroke-linejoin-round" })),
|
|
214
284
|
"treeview-expand": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
@@ -228,15 +298,22 @@ const icons = {
|
|
|
228
298
|
"user-profile": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
229
299
|
React.createElement("path", { d: "M8 7c1.66 0 3-1.34 3-3S9.66 1 8 1 5 2.34 5 4s1.34 3 3 3Z" }),
|
|
230
300
|
React.createElement("path", { d: "M2 16v-3c0-1.66 1.34-3 3-3h6c1.66 0 3 1.34 3 3v3", className: "stroke-linejoin-round" })),
|
|
301
|
+
"video-camera-off": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
302
|
+
React.createElement("path", { d: "M11 6V3H1v9.97h10V9.98L15 13V3.04L11 6ZM4 6l4 4M8 6.01 4 10", className: "stroke-linejoin-round" })),
|
|
303
|
+
"video-camera-on": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
304
|
+
React.createElement("path", { d: "M11 6V3H1v9.97L11 13v-3l4 3V3.04L11 6Z", className: "stroke-linejoin-round" })),
|
|
305
|
+
"video-camera-unavailable": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
306
|
+
React.createElement("path", { d: "M11 5.99V3H1v9.97h10V9.98L15 13V3.04l-4 2.95ZM4 8h4", className: "stroke-linejoin-round" })),
|
|
231
307
|
"video-off": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
232
|
-
React.createElement("
|
|
308
|
+
React.createElement("circle", { cx: "8", cy: "7", r: "5" }),
|
|
309
|
+
React.createElement("path", { d: "M3 15h10M8 15v-3M6.01 5.01 10 9M10 5 6 9", className: "stroke-linejoin-round" })),
|
|
233
310
|
"video-on": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
234
|
-
React.createElement("
|
|
235
|
-
React.createElement("
|
|
311
|
+
React.createElement("circle", { cx: "8", cy: "7", r: "5" }),
|
|
312
|
+
React.createElement("circle", { cx: "8", cy: "7", r: "2", className: "filled no-stroke" }),
|
|
236
313
|
React.createElement("path", { d: "M3 15h10M8 15v-3" })),
|
|
237
314
|
"video-unavailable": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
238
315
|
React.createElement("circle", { cx: "8", cy: "7", r: "5" }),
|
|
239
|
-
React.createElement("path", { d: "M3 15h10M6 7h4M8 15v-
|
|
316
|
+
React.createElement("path", { d: "M3 15h10M6 7h4M8 15v-3" })),
|
|
240
317
|
"view-full": React.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true" },
|
|
241
318
|
React.createElement("path", { d: "M15 1H1v14h14V1Z", className: "stroke-linejoin-round" }),
|
|
242
319
|
React.createElement("path", { d: "M11.5 4h-7a.5.5 0 0 0-.5.5v7a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5Z", className: "filled no-stroke" })),
|