@lobehub/ui 6.0.0-beta.5 → 6.0.0-beta.7
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/es/ActionIcon/style.mjs +1 -1
- package/es/ActionIcon/style.mjs.map +1 -1
- package/es/ColorSwatches/ColorSwatches.mjs +17 -22
- package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
- package/es/ColorSwatches/CustomPicker.mjs +101 -0
- package/es/ColorSwatches/CustomPicker.mjs.map +1 -0
- package/es/ColorSwatches/index.d.mts +2 -2
- package/es/ColorSwatches/marker.stylex.mjs +9 -0
- package/es/ColorSwatches/marker.stylex.mjs.map +1 -0
- package/es/ColorSwatches/style.mjs +36 -0
- package/es/ColorSwatches/style.mjs.map +1 -1
- package/es/ColorSwatches/type.d.mts +11 -2
- package/es/EditableText/EditableText.mjs +1 -1
- package/es/Grid/style.mjs +1 -1
- package/es/Grid/style.mjs.map +1 -1
- package/es/Image/type.d.mts +1 -0
- package/es/Image/viewer/ImageViewer.mjs +1 -0
- package/es/Image/viewer/ImageViewer.mjs.map +1 -1
- package/es/Image/viewer/Toolbar.mjs +19 -6
- package/es/Image/viewer/Toolbar.mjs.map +1 -1
- package/es/Image/viewer/ViewerChrome.mjs.map +1 -1
- package/es/Input/style.mjs +3 -3
- package/es/Input/style.mjs.map +1 -1
- package/es/Text/style.d.mts +3 -3
- package/es/awesome/Grainient/Grainient.d.mts +11 -0
- package/es/awesome/Grainient/Grainient.mjs +314 -0
- package/es/awesome/Grainient/Grainient.mjs.map +1 -0
- package/es/awesome/Grainient/index.d.mts +3 -0
- package/es/awesome/Grainient/style.mjs +23 -0
- package/es/awesome/Grainient/style.mjs.map +1 -0
- package/es/awesome/Grainient/type.d.mts +121 -0
- package/es/awesome/index.d.mts +4 -1
- package/es/awesome/index.mjs +2 -1
- package/es/dashboard/AuthLayout/Aside.d.mts +10 -0
- package/es/dashboard/AuthLayout/Aside.mjs +31 -0
- package/es/dashboard/AuthLayout/Aside.mjs.map +1 -0
- package/es/dashboard/AuthLayout/AuthLayout.d.mts +3 -1
- package/es/dashboard/AuthLayout/AuthLayout.mjs +93 -37
- package/es/dashboard/AuthLayout/AuthLayout.mjs.map +1 -1
- package/es/dashboard/AuthLayout/index.d.mts +3 -2
- package/es/dashboard/AuthLayout/style.mjs +98 -1
- package/es/dashboard/AuthLayout/style.mjs.map +1 -1
- package/es/dashboard/AuthLayout/type.d.mts +38 -2
- package/es/dashboard/AuthTools/AuthLocaleSwitch.d.mts +10 -0
- package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs +33 -0
- package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs.map +1 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.d.mts +10 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.mjs +59 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.mjs.map +1 -0
- package/es/dashboard/AuthTools/index.d.mts +4 -0
- package/es/dashboard/AuthTools/style.mjs +27 -0
- package/es/dashboard/AuthTools/style.mjs.map +1 -0
- package/es/dashboard/AuthTools/type.d.mts +29 -0
- package/es/dashboard/ChartGrid/ChartGrid.d.mts +10 -0
- package/es/dashboard/ChartGrid/ChartGrid.mjs +19 -0
- package/es/dashboard/ChartGrid/ChartGrid.mjs.map +1 -0
- package/es/dashboard/ChartGrid/index.d.mts +3 -0
- package/es/dashboard/ChartGrid/style.mjs +18 -0
- package/es/dashboard/ChartGrid/style.mjs.map +1 -0
- package/es/dashboard/ChartGrid/type.d.mts +8 -0
- package/es/dashboard/ConsoleNav/Skeleton.d.mts +15 -0
- package/es/dashboard/ConsoleNav/Skeleton.mjs +82 -0
- package/es/dashboard/ConsoleNav/Skeleton.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/index.d.mts +3 -2
- package/es/dashboard/ConsoleNav/style.mjs +18 -0
- package/es/dashboard/ConsoleNav/style.mjs.map +1 -1
- package/es/dashboard/ConsoleNav/type.d.mts +13 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.d.mts +1 -1
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs +26 -6
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/style.mjs +10 -0
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/type.d.mts +11 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs +18 -17
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs.map +1 -1
- package/es/dashboard/FilterStrip/FilterStrip.d.mts +11 -0
- package/es/dashboard/FilterStrip/FilterStrip.mjs +55 -0
- package/es/dashboard/FilterStrip/FilterStrip.mjs.map +1 -0
- package/es/dashboard/FilterStrip/index.d.mts +3 -0
- package/es/dashboard/FilterStrip/style.mjs +78 -0
- package/es/dashboard/FilterStrip/style.mjs.map +1 -0
- package/es/dashboard/FilterStrip/type.d.mts +25 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.d.mts +10 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.mjs +18 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.mjs.map +1 -0
- package/es/dashboard/LabelWithKey/index.d.mts +3 -0
- package/es/dashboard/LabelWithKey/type.d.mts +11 -0
- package/es/dashboard/MetricStrip/MetricCell.mjs +81 -0
- package/es/dashboard/MetricStrip/MetricCell.mjs.map +1 -0
- package/es/dashboard/MetricStrip/MetricStrip.d.mts +13 -0
- package/es/dashboard/MetricStrip/MetricStrip.mjs +47 -0
- package/es/dashboard/MetricStrip/MetricStrip.mjs.map +1 -0
- package/es/dashboard/MetricStrip/index.d.mts +3 -0
- package/es/dashboard/MetricStrip/style.mjs +156 -0
- package/es/dashboard/MetricStrip/style.mjs.map +1 -0
- package/es/dashboard/MetricStrip/type.d.mts +36 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs +20 -18
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs.map +1 -1
- package/es/dashboard/PageSkeleton/style.mjs +1 -1
- package/es/dashboard/PageSkeleton/style.mjs.map +1 -1
- package/es/dashboard/PageToolbar/PageToolbar.d.mts +10 -0
- package/es/dashboard/PageToolbar/PageToolbar.mjs +22 -0
- package/es/dashboard/PageToolbar/PageToolbar.mjs.map +1 -0
- package/es/dashboard/PageToolbar/index.d.mts +3 -0
- package/es/dashboard/PageToolbar/style.mjs +36 -0
- package/es/dashboard/PageToolbar/style.mjs.map +1 -0
- package/es/dashboard/PageToolbar/type.d.mts +11 -0
- package/es/dashboard/PanelSurface/PanelSurface.d.mts +10 -0
- package/es/dashboard/PanelSurface/PanelSurface.mjs +40 -0
- package/es/dashboard/PanelSurface/PanelSurface.mjs.map +1 -0
- package/es/dashboard/PanelSurface/index.d.mts +3 -0
- package/es/dashboard/PanelSurface/style.mjs +25 -0
- package/es/dashboard/PanelSurface/style.mjs.map +1 -0
- package/es/dashboard/PanelSurface/type.d.mts +17 -0
- package/es/dashboard/Section/Section.d.mts +10 -0
- package/es/dashboard/Section/Section.mjs +81 -0
- package/es/dashboard/Section/Section.mjs.map +1 -0
- package/es/dashboard/Section/index.d.mts +3 -0
- package/es/dashboard/Section/style.mjs +31 -0
- package/es/dashboard/Section/style.mjs.map +1 -0
- package/es/dashboard/Section/type.d.mts +23 -0
- package/es/dashboard/StatCard/StatCard.d.mts +2 -1
- package/es/dashboard/StatCard/StatCard.mjs +28 -91
- package/es/dashboard/StatCard/StatCard.mjs.map +1 -1
- package/es/dashboard/StatCard/type.d.mts +16 -5
- package/es/dashboard/Surface/Surface.d.mts +4 -3
- package/es/dashboard/Surface/Surface.mjs +91 -8
- package/es/dashboard/Surface/Surface.mjs.map +1 -1
- package/es/dashboard/Surface/index.d.mts +3 -2
- package/es/dashboard/Surface/link.d.mts +16 -0
- package/es/dashboard/Surface/link.mjs +40 -0
- package/es/dashboard/Surface/link.mjs.map +1 -0
- package/es/dashboard/Surface/marker.stylex.mjs +9 -0
- package/es/dashboard/Surface/marker.stylex.mjs.map +1 -0
- package/es/dashboard/Surface/style.d.mts +2 -0
- package/es/dashboard/Surface/style.mjs +155 -14
- package/es/dashboard/Surface/style.mjs.map +1 -1
- package/es/dashboard/Surface/type.d.mts +29 -1
- package/es/dashboard/TableIconActions/TableIconActions.d.mts +17 -0
- package/es/dashboard/TableIconActions/TableIconActions.mjs +39 -0
- package/es/dashboard/TableIconActions/TableIconActions.mjs.map +1 -0
- package/es/dashboard/TableIconActions/index.d.mts +3 -0
- package/es/dashboard/TableIconActions/type.d.mts +17 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.d.mts +10 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.mjs +28 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.mjs.map +1 -0
- package/es/dashboard/TitleWithTips/index.d.mts +3 -0
- package/es/dashboard/TitleWithTips/type.d.mts +10 -0
- package/es/dashboard/index.d.mts +38 -4
- package/es/dashboard/index.mjs +17 -3
- package/es/index.d.mts +3 -2
- package/es/index.mjs +5 -4
- package/es/style.css +339 -32
- package/es/styles/createGlobalStyle.mjs +1 -1
- package/es/styles/index.d.mts +3 -2
- package/es/styles/index.mjs +5 -4
- package/es/styles/theme/createLobeToken.d.mts +3 -2
- package/es/styles/theme/createLobeToken.mjs.map +1 -1
- package/es/styles/theme/customPrimary.d.mts +7 -0
- package/es/styles/theme/customPrimary.mjs +66 -0
- package/es/styles/theme/customPrimary.mjs.map +1 -0
- package/es/styles/theme/scope.d.mts +4 -3
- package/es/styles/theme/scope.mjs +30 -8
- package/es/styles/theme/scope.mjs.map +1 -1
- package/es/styles/theme/themeCss.d.mts +2 -0
- package/es/styles/theme/themeCss.mjs +9 -2
- package/es/styles/theme/themeCss.mjs.map +1 -1
- package/es/styles/theme/token/primary.mjs +6 -2
- package/es/styles/theme/token/primary.mjs.map +1 -1
- package/package.json +1 -1
- package/es/dashboard/StatCard/style.mjs +0 -105
- package/es/dashboard/StatCard/style.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewerChrome.mjs","names":["imageMessages","ActionIcon"],"sources":["../../../src/Image/viewer/ViewerChrome.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { X } from 'lucide-react';\nimport type { MotionValue } from 'motion/react';\nimport { memo, type MouseEvent, type ReactNode, useCallback } from 'react';\n\nimport { ActionIconImpl as ActionIcon } from '@/ActionIcon/ActionIcon';\nimport imageMessages from '@/i18n/resources/en/image';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { styles } from '../style';\nimport GalleryNav from './GalleryNav';\nimport type { Rect, Rotation, Size } from './geometry';\nimport Toolbar from './Toolbar';\nimport { useChromeIdle } from './useChromeIdle';\n\nexport interface ViewerChromeProps {\n canZoomIn: boolean;\n canZoomOut: boolean;\n chromeRef: (node: HTMLElement | null) => void;\n current: number;\n fitRect: Rect;\n flipHorizontal: () => void;\n flipVertical: () => void;\n hasNext: boolean;\n hasPrev: boolean;\n natural: Size;\n next: () => void;\n onClose: () => void;\n onDownload?: (source: string) => void | Promise<void>;\n prev: () => void;\n rotateLeft: () => void;\n rotateRight: () => void;\n rotation: Rotation;\n scale: MotionValue<number>;\n source: string;\n toggleActualSize: () => void;\n toolbarAddon?: ReactNode;\n total: number;\n zoomIn: () => void;\n zoomOut: () => void;\n}\n\nconst ViewerChrome = memo<ViewerChromeProps>(\n ({ chromeRef, current, hasNext, hasPrev, next, onClose, prev, total, ...toolbarProps }) => {\n const { t } = useTranslation(imageMessages);\n const idle = useChromeIdle();\n\n const handleChromeClick = useCallback((event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n }, []);\n\n return (\n <div {...stylex.props(styles.viewerChrome)} ref={chromeRef} onClick={handleChromeClick}>\n <div\n {...stylex.props(styles.viewerChromeIdle)}\n data-idle-hidden={idle.hidden ? '' : undefined}\n ref={idle.ref}\n >\n <ActionIcon\n className=\"lobe-image-viewer-close\"\n icon={X}\n title={t('image.close')}\n xstyle={styles.viewerClose}\n onClick={onClose}\n />\n {total > 1 && (\n <GalleryNav\n current={current}\n hasNext={hasNext}\n hasPrev={hasPrev}\n next={next}\n prev={prev}\n total={total}\n />\n )}\n <Toolbar {...toolbarProps} onMoreOpenChange={idle.setHeld} />\n </div>\n </div>\n );\n },\n);\n\nViewerChrome.displayName = 'ViewerChrome';\n\nexport default ViewerChrome;\n"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ViewerChrome.mjs","names":["imageMessages","ActionIcon"],"sources":["../../../src/Image/viewer/ViewerChrome.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { X } from 'lucide-react';\nimport type { MotionValue } from 'motion/react';\nimport { memo, type MouseEvent, type ReactNode, useCallback } from 'react';\n\nimport { ActionIconImpl as ActionIcon } from '@/ActionIcon/ActionIcon';\nimport imageMessages from '@/i18n/resources/en/image';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { styles } from '../style';\nimport GalleryNav from './GalleryNav';\nimport type { Rect, Rotation, Size } from './geometry';\nimport Toolbar from './Toolbar';\nimport { useChromeIdle } from './useChromeIdle';\n\nexport interface ViewerChromeProps {\n canZoomIn: boolean;\n canZoomOut: boolean;\n chromeRef: (node: HTMLElement | null) => void;\n current: number;\n fetchImage?: (source: string) => Promise<Blob>;\n fitRect: Rect;\n flipHorizontal: () => void;\n flipVertical: () => void;\n hasNext: boolean;\n hasPrev: boolean;\n natural: Size;\n next: () => void;\n onClose: () => void;\n onDownload?: (source: string) => void | Promise<void>;\n prev: () => void;\n rotateLeft: () => void;\n rotateRight: () => void;\n rotation: Rotation;\n scale: MotionValue<number>;\n source: string;\n toggleActualSize: () => void;\n toolbarAddon?: ReactNode;\n total: number;\n zoomIn: () => void;\n zoomOut: () => void;\n}\n\nconst ViewerChrome = memo<ViewerChromeProps>(\n ({ chromeRef, current, hasNext, hasPrev, next, onClose, prev, total, ...toolbarProps }) => {\n const { t } = useTranslation(imageMessages);\n const idle = useChromeIdle();\n\n const handleChromeClick = useCallback((event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n }, []);\n\n return (\n <div {...stylex.props(styles.viewerChrome)} ref={chromeRef} onClick={handleChromeClick}>\n <div\n {...stylex.props(styles.viewerChromeIdle)}\n data-idle-hidden={idle.hidden ? '' : undefined}\n ref={idle.ref}\n >\n <ActionIcon\n className=\"lobe-image-viewer-close\"\n icon={X}\n title={t('image.close')}\n xstyle={styles.viewerClose}\n onClick={onClose}\n />\n {total > 1 && (\n <GalleryNav\n current={current}\n hasNext={hasNext}\n hasPrev={hasPrev}\n next={next}\n prev={prev}\n total={total}\n />\n )}\n <Toolbar {...toolbarProps} onMoreOpenChange={idle.setHeld} />\n </div>\n </div>\n );\n },\n);\n\nViewerChrome.displayName = 'ViewerChrome';\n\nexport default ViewerChrome;\n"],"mappings":";;;;;;;;;;;;;AAyCA,MAAM,eAAe,MAAyB,EAC5C,WACA,SACA,SACA,SACA,MACA,SACA,MACA,OACA,GAAG,mBACC;CACJ,MAAM,EACJ,MACE,eAAeA,aAAa;CAChC,MAAM,OAAO,cAAc;CAC3B,MAAM,oBAAoB,aAAa,UAAsC;EAC3E,MAAM,gBAAgB;CACxB,GAAG,CAAC,CAAC;CACL,OAAO,oBAAC,OAAD;EAAK,GAAI,OAAO,MAAM,OAAO,YAAY;EAAG,KAAK;EAAW,SAAS;EACtE,UAAA,qBAAC,OAAD;GAAK,GAAI,OAAO,MAAM,OAAO,gBAAgB;GAAG,oBAAkB,KAAK,SAAS,KAAK,KAAA;GAAW,KAAK,KAAK;GAA1G,UAAA;IACE,oBAACC,gBAAD;KAAY,WAAU;KAA0B,MAAM;KAAG,OAAO,EAAE,aAAa;KAAG,QAAQ,OAAO;KAAa,SAAS;IAAU,CAAA;IAChI,QAAQ,KAAK,oBAAC,YAAD;KAAqB;KAAkB;KAAkB;KAAe;KAAY;KAAa;IAAQ,CAAA;IACvH,oBAAC,SAAD;KAAS,GAAI;KAAc,kBAAkB,KAAK;IAAU,CAAA;GACzD;;CACF,CAAA;AACX,CAAC;AACD,aAAa,cAAc"}
|
package/es/Input/style.mjs
CHANGED
|
@@ -164,11 +164,11 @@ const styles = {
|
|
|
164
164
|
kmkexE: "lbavbupb",
|
|
165
165
|
kGNEyG: "lb6s0dn4",
|
|
166
166
|
kB7OPa: "lb9f619",
|
|
167
|
-
kMwMTN: "lb66ogz0
|
|
168
|
-
kkrTdU: "lb1ed109x
|
|
167
|
+
kMwMTN: "lb66ogz0 lb1k6ehaq",
|
|
168
|
+
kkrTdU: "lb1ed109x lb1btkyy5",
|
|
169
169
|
k1xSpc: "lb3nfvp2",
|
|
170
170
|
kGuDYH: "lbif65rj",
|
|
171
|
-
kSiTet: "
|
|
171
|
+
kSiTet: "lb1gf9ui9",
|
|
172
172
|
kzqmXN: "lbh8yej3",
|
|
173
173
|
$$css: true
|
|
174
174
|
},
|
package/es/Input/style.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":[],"sources":["../../src/Input/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { inputMarker } from './marker.stylex';\nimport type { InputSize, InputVariant } from './type';\n\nconst disabled = ':is([data-disabled], :has(:disabled))';\nconst hover = ':hover:not(:focus-within, [data-disabled])';\nconst invalid = \":has([data-invalid], [aria-invalid='true'])\";\nconst invalidIdle =\n \":has([data-invalid], [aria-invalid='true']):is(:focus-within, :not(:hover), [data-disabled])\";\nconst invalidFocus = \":has([data-invalid], [aria-invalid='true']):focus-within\";\nconst validFocus = \":focus-within:not(:has([data-invalid], [aria-invalid='true']))\";\n\nconst lobeShadow = `0 1px 0 -1px ${cssVar.colorBorder}, 0 1px 2px -0.5px ${cssVar.colorBorder}, 0 2px 2px -1px ${cssVar.colorBorderSecondary}, 0 3px 6px -4px ${cssVar.colorBorderSecondary}`;\nconst primaryRing = `0 0 0 2px ${cssVar.colorPrimaryBg}`;\nconst errorRing = `0 0 0 2px ${cssVar.colorErrorBg}`;\n\nexport const styles = stylex.create({\n borderless: {\n borderColor: { default: 'transparent', [invalid]: cssVar.colorError },\n borderStyle: 'solid',\n borderWidth: 1,\n backgroundColor: 'transparent',\n backgroundImage: 'none',\n boxShadow: { default: null, [invalidFocus]: errorRing },\n },\n clear: {\n padding: 0,\n borderColor: 'currentcolor',\n borderRadius: '50%',\n borderStyle: 'none',\n borderWidth: 0,\n flex: 'none',\n alignItems: 'center',\n backgroundColor: {\n 'default': cssVar.colorTextQuaternary,\n ':hover': cssVar.colorTextTertiary,\n },\n color: cssVar.colorBgContainer,\n cursor: 'pointer',\n display: 'inline-flex',\n justifyContent: 'center',\n visibility: {\n default: 'hidden',\n [stylex.when.ancestor(':focus-within', inputMarker)]: 'visible',\n [stylex.when.ancestor(':hover', inputMarker)]: 'visible',\n },\n height: 16,\n width: 16,\n },\n count: {\n borderRadius: 999,\n paddingInline: 8,\n alignItems: 'center',\n backgroundColor: {\n 'default': cssVar.colorFillTertiary,\n ':is([data-over])': cssVar.colorError,\n },\n color: {\n 'default': cssVar.colorTextSecondary,\n ':is([data-over])': cssVar.colorWhite,\n },\n display: 'inline-flex',\n fontSize: 11,\n fontVariantNumeric: 'tabular-nums',\n fontWeight: 600,\n insetBlockEnd: 6,\n insetInlineEnd: 8,\n pointerEvents: 'none',\n position: 'absolute',\n height: 20,\n },\n filled: {\n borderColor: { default: 'transparent', [invalid]: cssVar.colorError },\n borderStyle: 'solid',\n borderWidth: 1,\n backgroundColor: {\n default: cssVar.colorFillTertiary,\n [hover]: cssVar.colorFillSecondary,\n },\n boxShadow: { default: null, [invalidFocus]: errorRing },\n },\n input: {\n 'font': 'inherit',\n 'padding': 0,\n 'borderColor': 'currentcolor',\n 'borderStyle': 'none',\n 'borderWidth': 'medium',\n 'flex': '1',\n 'outline': 'none',\n 'appearance': 'none',\n 'backgroundColor': 'transparent',\n 'color': 'inherit',\n 'minWidth': 0,\n '::placeholder': {\n color: cssVar.colorTextPlaceholder,\n },\n },\n numberControl: {\n margin: 0,\n padding: 0,\n borderColor: 'currentcolor',\n borderRadius: 4,\n borderStyle: 'none',\n borderWidth: 'medium',\n outline: 'none',\n transition: `color 150ms ${cssVar.motionEaseOut}, background 150ms ${cssVar.motionEaseOut}`,\n alignItems: 'center',\n backgroundColor: {\n 'default': 'transparent',\n ':hover:not(:disabled)': cssVar.colorFillSecondary,\n },\n color: {\n 'default': cssVar.colorTextTertiary,\n ':hover:not(:disabled)': cssVar.colorText,\n },\n cursor: { 'default': 'pointer', ':disabled': 'not-allowed' },\n display: 'flex',\n justifyContent: 'center',\n opacity: { 'default': null, ':disabled': 0.3 },\n height: 13,\n width: 20,\n },\n numberControlLarge: {\n height: 15,\n width: 22,\n },\n numberControls: {\n flex: 'none',\n display: 'flex',\n flexDirection: 'column',\n marginInlineEnd: -6,\n },\n numberControlSmall: {\n borderRadius: 3,\n height: 10,\n width: 16,\n },\n numberControlsSmall: {\n marginInlineEnd: -4,\n },\n numberInput: {\n fontVariantNumeric: 'tabular-nums',\n },\n otpCell: {\n flex: 'none',\n paddingInline: 0,\n textAlign: 'center',\n width: 32,\n },\n otpRoot: {\n gap: 8,\n alignItems: 'center',\n display: 'inline-flex',\n },\n outlined: {\n borderColor: {\n default: cssVar.colorBorderSecondary,\n [hover]: cssVar.colorBorder,\n [invalidIdle]: cssVar.colorError,\n [validFocus]: cssVar.colorPrimary,\n },\n borderStyle: 'solid',\n borderWidth: 1,\n backgroundColor: cssVar.colorBgContainer,\n boxShadow: { default: null, [invalidFocus]: errorRing, [validFocus]: primaryRing },\n },\n passwordToggle: {\n margin: 0,\n padding: 0,\n borderColor: 'currentcolor',\n borderStyle: 'none',\n borderWidth: 'medium',\n outline: 'none',\n transition: `color 150ms ${cssVar.motionEaseOut}`,\n alignItems: 'center',\n backgroundColor: 'transparent',\n color: { 'default': cssVar.colorTextTertiary, ':hover': cssVar.colorText },\n cursor: 'pointer',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n root: {\n borderRadius: cssVar.borderRadius,\n gap: 8,\n paddingInline: 12,\n transition: `background 150ms ${cssVar.motionEaseOut}, border-color 150ms ${cssVar.motionEaseOut}, box-shadow 150ms ${cssVar.motionEaseOut}`,\n alignItems: 'center',\n boxSizing: 'border-box',\n color: { default: cssVar.colorText, [disabled]: cssVar.colorTextQuaternary },\n cursor: { default: 'text', [disabled]: 'not-allowed' },\n display: 'inline-flex',\n fontSize: 14,\n opacity: { default: null, [disabled]: 0.66 },\n width: '100%',\n },\n shadow: {\n boxShadow: { default: lobeShadow, [invalidFocus]: errorRing },\n },\n shadowOutlined: {\n boxShadow: { default: lobeShadow, [invalidFocus]: errorRing, [validFocus]: primaryRing },\n },\n sizeLarge: {\n borderRadius: cssVar.borderRadiusLG,\n fontSize: 16,\n minHeight: 40,\n },\n sizeMiddle: {\n minHeight: 32,\n },\n sizeSmall: {\n borderRadius: cssVar.borderRadiusSM,\n paddingInline: 8,\n fontSize: 12,\n minHeight: 24,\n },\n slot: {\n flex: 'none',\n alignItems: 'center',\n color: cssVar.colorTextTertiary,\n display: 'inline-flex',\n },\n textarea: {\n paddingBlock: 8,\n position: 'relative',\n height: 'auto',\n },\n textareaAutoSize: {\n fieldSizing: 'content',\n },\n textareaClear: {\n insetBlockStart: 10,\n insetInlineEnd: 10,\n position: 'absolute',\n },\n textareaControl: {\n lineHeight: 1.5,\n resize: 'none',\n maxHeight: 'var(--textarea-max-height, none)',\n minHeight: 'calc(1.5em * var(--textarea-min-rows, 2))',\n },\n textareaResize: {\n resize: 'vertical',\n },\n textareaWithCount: {\n paddingBlockEnd: 30,\n },\n});\n\nconst sizeStyles = {\n large: styles.sizeLarge,\n middle: styles.sizeMiddle,\n small: styles.sizeSmall,\n};\n\nconst variantStyles = {\n borderless: styles.borderless,\n filled: styles.filled,\n outlined: styles.outlined,\n};\n\ninterface RootOptions {\n shadow?: boolean | null;\n size?: InputSize | null;\n variant?: InputVariant | null;\n}\n\nexport const inputRootStyles = ({ shadow, size, variant }: RootOptions = {}) => {\n const mergedVariant = variant || 'outlined';\n return [\n inputMarker,\n styles.root,\n sizeStyles[size || 'middle'],\n variantStyles[mergedVariant],\n shadow && (mergedVariant === 'outlined' ? styles.shadowOutlined : styles.shadow),\n ];\n};\n\nexport const rootVariants = (options?: RootOptions) =>\n stylex.props(inputRootStyles(options)).className ?? '';\n\nconst className = (style: Parameters<typeof styleProps>[0]) => styleProps(style).className;\n\nexport const inputClassNames = {\n borderless: className(styles.borderless),\n clear: className(styles.clear),\n count: className(styles.count),\n filled: className(styles.filled),\n input: className(styles.input),\n invalid: '',\n numberControl: className(styles.numberControl),\n numberControlLarge: className(styles.numberControlLarge),\n numberControls: className(styles.numberControls),\n numberControlSmall: className(styles.numberControlSmall),\n numberControlsSmall: className(styles.numberControlsSmall),\n numberInput: className(styles.numberInput),\n otpCell: className(styles.otpCell),\n otpRoot: className(styles.otpRoot),\n outlined: className(styles.outlined),\n passwordToggle: className(styles.passwordToggle),\n root: className([inputMarker, styles.root]),\n shadow: className(styles.shadow),\n sizeLarge: className(styles.sizeLarge),\n sizeMiddle: className(styles.sizeMiddle),\n sizeSmall: className(styles.sizeSmall),\n slot: className(styles.slot),\n textarea: className(styles.textarea),\n textareaAutoSize: className(styles.textareaAutoSize),\n textareaClear: className(styles.textareaClear),\n textareaResize: className(styles.textareaResize),\n textareaWithCount: className(styles.textareaWithCount),\n};\n"],"mappings":";;;;;AAamB,GAAgB,OAAO,cAAiC,OAAO,cAA+B,OAAO,uBAAwC,OAAO;AACnJ,GAAa,OAAO;AACtB,GAAa,OAAO;AACtC,MAAa,SAAS;CACpB,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;E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version":3,"file":"style.mjs","names":[],"sources":["../../src/Input/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { inputMarker } from './marker.stylex';\nimport type { InputSize, InputVariant } from './type';\n\nexport const disabledControl = 'input:disabled, textarea:disabled';\n\nconst disabled = `:is([data-disabled], :has(${disabledControl}))`;\nconst hover = ':hover:not(:focus-within, [data-disabled])';\nconst invalid = \":has([data-invalid], [aria-invalid='true'])\";\nconst invalidIdle =\n \":has([data-invalid], [aria-invalid='true']):is(:focus-within, :not(:hover), [data-disabled])\";\nconst invalidFocus = \":has([data-invalid], [aria-invalid='true']):focus-within\";\nconst validFocus = \":focus-within:not(:has([data-invalid], [aria-invalid='true']))\";\n\nconst lobeShadow = `0 1px 0 -1px ${cssVar.colorBorder}, 0 1px 2px -0.5px ${cssVar.colorBorder}, 0 2px 2px -1px ${cssVar.colorBorderSecondary}, 0 3px 6px -4px ${cssVar.colorBorderSecondary}`;\nconst primaryRing = `0 0 0 2px ${cssVar.colorPrimaryBg}`;\nconst errorRing = `0 0 0 2px ${cssVar.colorErrorBg}`;\n\nexport const styles = stylex.create({\n borderless: {\n borderColor: { default: 'transparent', [invalid]: cssVar.colorError },\n borderStyle: 'solid',\n borderWidth: 1,\n backgroundColor: 'transparent',\n backgroundImage: 'none',\n boxShadow: { default: null, [invalidFocus]: errorRing },\n },\n clear: {\n padding: 0,\n borderColor: 'currentcolor',\n borderRadius: '50%',\n borderStyle: 'none',\n borderWidth: 0,\n flex: 'none',\n alignItems: 'center',\n backgroundColor: {\n 'default': cssVar.colorTextQuaternary,\n ':hover': cssVar.colorTextTertiary,\n },\n color: cssVar.colorBgContainer,\n cursor: 'pointer',\n display: 'inline-flex',\n justifyContent: 'center',\n visibility: {\n default: 'hidden',\n [stylex.when.ancestor(':focus-within', inputMarker)]: 'visible',\n [stylex.when.ancestor(':hover', inputMarker)]: 'visible',\n },\n height: 16,\n width: 16,\n },\n count: {\n borderRadius: 999,\n paddingInline: 8,\n alignItems: 'center',\n backgroundColor: {\n 'default': cssVar.colorFillTertiary,\n ':is([data-over])': cssVar.colorError,\n },\n color: {\n 'default': cssVar.colorTextSecondary,\n ':is([data-over])': cssVar.colorWhite,\n },\n display: 'inline-flex',\n fontSize: 11,\n fontVariantNumeric: 'tabular-nums',\n fontWeight: 600,\n insetBlockEnd: 6,\n insetInlineEnd: 8,\n pointerEvents: 'none',\n position: 'absolute',\n height: 20,\n },\n filled: {\n borderColor: { default: 'transparent', [invalid]: cssVar.colorError },\n borderStyle: 'solid',\n borderWidth: 1,\n backgroundColor: {\n default: cssVar.colorFillTertiary,\n [hover]: cssVar.colorFillSecondary,\n },\n boxShadow: { default: null, [invalidFocus]: errorRing },\n },\n input: {\n 'font': 'inherit',\n 'padding': 0,\n 'borderColor': 'currentcolor',\n 'borderStyle': 'none',\n 'borderWidth': 'medium',\n 'flex': '1',\n 'outline': 'none',\n 'appearance': 'none',\n 'backgroundColor': 'transparent',\n 'color': 'inherit',\n 'minWidth': 0,\n '::placeholder': {\n color: cssVar.colorTextPlaceholder,\n },\n },\n numberControl: {\n margin: 0,\n padding: 0,\n borderColor: 'currentcolor',\n borderRadius: 4,\n borderStyle: 'none',\n borderWidth: 'medium',\n outline: 'none',\n transition: `color 150ms ${cssVar.motionEaseOut}, background 150ms ${cssVar.motionEaseOut}`,\n alignItems: 'center',\n backgroundColor: {\n 'default': 'transparent',\n ':hover:not(:disabled)': cssVar.colorFillSecondary,\n },\n color: {\n 'default': cssVar.colorTextTertiary,\n ':hover:not(:disabled)': cssVar.colorText,\n },\n cursor: { 'default': 'pointer', ':disabled': 'not-allowed' },\n display: 'flex',\n justifyContent: 'center',\n opacity: { 'default': null, ':disabled': 0.3 },\n height: 13,\n width: 20,\n },\n numberControlLarge: {\n height: 15,\n width: 22,\n },\n numberControls: {\n flex: 'none',\n display: 'flex',\n flexDirection: 'column',\n marginInlineEnd: -6,\n },\n numberControlSmall: {\n borderRadius: 3,\n height: 10,\n width: 16,\n },\n numberControlsSmall: {\n marginInlineEnd: -4,\n },\n numberInput: {\n fontVariantNumeric: 'tabular-nums',\n },\n otpCell: {\n flex: 'none',\n paddingInline: 0,\n textAlign: 'center',\n width: 32,\n },\n otpRoot: {\n gap: 8,\n alignItems: 'center',\n display: 'inline-flex',\n },\n outlined: {\n borderColor: {\n default: cssVar.colorBorderSecondary,\n [hover]: cssVar.colorBorder,\n [invalidIdle]: cssVar.colorError,\n [validFocus]: cssVar.colorPrimary,\n },\n borderStyle: 'solid',\n borderWidth: 1,\n backgroundColor: cssVar.colorBgContainer,\n boxShadow: { default: null, [invalidFocus]: errorRing, [validFocus]: primaryRing },\n },\n passwordToggle: {\n margin: 0,\n padding: 0,\n borderColor: 'currentcolor',\n borderStyle: 'none',\n borderWidth: 'medium',\n outline: 'none',\n transition: `color 150ms ${cssVar.motionEaseOut}`,\n alignItems: 'center',\n backgroundColor: 'transparent',\n color: { 'default': cssVar.colorTextTertiary, ':hover': cssVar.colorText },\n cursor: 'pointer',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n root: {\n borderRadius: cssVar.borderRadius,\n gap: 8,\n paddingInline: 12,\n transition: `background 150ms ${cssVar.motionEaseOut}, border-color 150ms ${cssVar.motionEaseOut}, box-shadow 150ms ${cssVar.motionEaseOut}`,\n alignItems: 'center',\n boxSizing: 'border-box',\n color: { default: cssVar.colorText, [disabled]: cssVar.colorTextQuaternary },\n cursor: { default: 'text', [disabled]: 'not-allowed' },\n display: 'inline-flex',\n fontSize: 14,\n opacity: { default: null, [disabled]: 0.66 },\n width: '100%',\n },\n shadow: {\n boxShadow: { default: lobeShadow, [invalidFocus]: errorRing },\n },\n shadowOutlined: {\n boxShadow: { default: lobeShadow, [invalidFocus]: errorRing, [validFocus]: primaryRing },\n },\n sizeLarge: {\n borderRadius: cssVar.borderRadiusLG,\n fontSize: 16,\n minHeight: 40,\n },\n sizeMiddle: {\n minHeight: 32,\n },\n sizeSmall: {\n borderRadius: cssVar.borderRadiusSM,\n paddingInline: 8,\n fontSize: 12,\n minHeight: 24,\n },\n slot: {\n flex: 'none',\n alignItems: 'center',\n color: cssVar.colorTextTertiary,\n display: 'inline-flex',\n },\n textarea: {\n paddingBlock: 8,\n position: 'relative',\n height: 'auto',\n },\n textareaAutoSize: {\n fieldSizing: 'content',\n },\n textareaClear: {\n insetBlockStart: 10,\n insetInlineEnd: 10,\n position: 'absolute',\n },\n textareaControl: {\n lineHeight: 1.5,\n resize: 'none',\n maxHeight: 'var(--textarea-max-height, none)',\n minHeight: 'calc(1.5em * var(--textarea-min-rows, 2))',\n },\n textareaResize: {\n resize: 'vertical',\n },\n textareaWithCount: {\n paddingBlockEnd: 30,\n },\n});\n\nconst sizeStyles = {\n large: styles.sizeLarge,\n middle: styles.sizeMiddle,\n small: styles.sizeSmall,\n};\n\nconst variantStyles = {\n borderless: styles.borderless,\n filled: styles.filled,\n outlined: styles.outlined,\n};\n\ninterface RootOptions {\n shadow?: boolean | null;\n size?: InputSize | null;\n variant?: InputVariant | null;\n}\n\nexport const inputRootStyles = ({ shadow, size, variant }: RootOptions = {}) => {\n const mergedVariant = variant || 'outlined';\n return [\n inputMarker,\n styles.root,\n sizeStyles[size || 'middle'],\n variantStyles[mergedVariant],\n shadow && (mergedVariant === 'outlined' ? styles.shadowOutlined : styles.shadow),\n ];\n};\n\nexport const rootVariants = (options?: RootOptions) =>\n stylex.props(inputRootStyles(options)).className ?? '';\n\nconst className = (style: Parameters<typeof styleProps>[0]) => styleProps(style).className;\n\nexport const inputClassNames = {\n borderless: className(styles.borderless),\n clear: className(styles.clear),\n count: className(styles.count),\n filled: className(styles.filled),\n input: className(styles.input),\n invalid: '',\n numberControl: className(styles.numberControl),\n numberControlLarge: className(styles.numberControlLarge),\n numberControls: className(styles.numberControls),\n numberControlSmall: className(styles.numberControlSmall),\n numberControlsSmall: className(styles.numberControlsSmall),\n numberInput: className(styles.numberInput),\n otpCell: className(styles.otpCell),\n otpRoot: className(styles.otpRoot),\n outlined: className(styles.outlined),\n passwordToggle: className(styles.passwordToggle),\n root: className([inputMarker, styles.root]),\n shadow: className(styles.shadow),\n sizeLarge: className(styles.sizeLarge),\n sizeMiddle: className(styles.sizeMiddle),\n sizeSmall: className(styles.sizeSmall),\n slot: className(styles.slot),\n textarea: className(styles.textarea),\n textareaAutoSize: className(styles.textareaAutoSize),\n textareaClear: className(styles.textareaClear),\n textareaResize: className(styles.textareaResize),\n textareaWithCount: className(styles.textareaWithCount),\n};\n"],"mappings":";;;;;AAcmB,GAAgB,OAAO,cAAiC,OAAO,cAA+B,OAAO,uBAAwC,OAAO;AACnJ,GAAa,OAAO;AACtB,GAAa,OAAO;AACtC,MAAa,SAAS;CACpB,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT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,oBAAoB,UAAU,OAAO,kBAAkB;CACvD,gBAAgB,UAAU,OAAO,cAAc;CAC/C,oBAAoB,UAAU,OAAO,kBAAkB;CACvD,qBAAqB,UAAU,OAAO,mBAAmB;CACzD,aAAa,UAAU,OAAO,WAAW;CACzC,SAAS,UAAU,OAAO,OAAO;CACjC,SAAS,UAAU,OAAO,OAAO;CACjC,UAAU,UAAU,OAAO,QAAQ;CACnC,gBAAgB,UAAU,OAAO,cAAc;CAC/C,MAAM,UAAU,CAAC,aAAa,OAAO,IAAI,CAAC;CAC1C,QAAQ,UAAU,OAAO,MAAM;CAC/B,WAAW,UAAU,OAAO,SAAS;CACrC,YAAY,UAAU,OAAO,UAAU;CACvC,WAAW,UAAU,OAAO,SAAS;CACrC,MAAM,UAAU,OAAO,IAAI;CAC3B,UAAU,UAAU,OAAO,QAAQ;CACnC,kBAAkB,UAAU,OAAO,gBAAgB;CACnD,eAAe,UAAU,OAAO,aAAa;CAC7C,gBAAgB,UAAU,OAAO,cAAc;CAC/C,mBAAmB,UAAU,OAAO,iBAAiB;AACvD"}
|
package/es/Text/style.d.mts
CHANGED
|
@@ -14,13 +14,13 @@ export declare const textStyles: {
|
|
|
14
14
|
text: string;
|
|
15
15
|
disabled: string;
|
|
16
16
|
danger: string;
|
|
17
|
+
success: string;
|
|
18
|
+
info: string;
|
|
19
|
+
warning: string;
|
|
17
20
|
delete: string;
|
|
18
21
|
ellipsis: string;
|
|
19
22
|
italic: string;
|
|
20
23
|
underline: string;
|
|
21
|
-
success: string;
|
|
22
|
-
warning: string;
|
|
23
|
-
info: string;
|
|
24
24
|
ellipsisMulti: string;
|
|
25
25
|
secondary: string;
|
|
26
26
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GrainientProps } from "./type.mjs";
|
|
2
|
+
//#region src/awesome/Grainient/Grainient.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Animated grainy gradient (WebGL2, no extra dependency). Fills its nearest positioned ancestor,
|
|
5
|
+
* pauses when off-screen or the tab is hidden, and draws one still frame when reduced motion is
|
|
6
|
+
* preferred. Without WebGL2 it renders nothing, so give the parent a fallback background.
|
|
7
|
+
*/
|
|
8
|
+
declare const Grainient: import("react").NamedExoticComponent<GrainientProps>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Grainient as default };
|
|
11
|
+
//# sourceMappingURL=Grainient.d.mts.map
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { styleProps } from "../../styles/stylex/props.mjs";
|
|
3
|
+
import { useThemeMode } from "../../styles/theme/scope.mjs";
|
|
4
|
+
import { styles } from "./style.mjs";
|
|
5
|
+
import { memo, useEffect, useRef } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import * as stylex from "@stylexjs/stylex";
|
|
8
|
+
//#region src/awesome/Grainient/Grainient.tsx
|
|
9
|
+
const VERTEX_SHADER = `#version 300 es
|
|
10
|
+
in vec2 position;
|
|
11
|
+
void main() {
|
|
12
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
const FRAGMENT_SHADER = `#version 300 es
|
|
16
|
+
precision highp float;
|
|
17
|
+
uniform vec2 iResolution;
|
|
18
|
+
uniform float iTime;
|
|
19
|
+
uniform float uTimeSpeed;
|
|
20
|
+
uniform float uColorBalance;
|
|
21
|
+
uniform float uWarpStrength;
|
|
22
|
+
uniform float uWarpFrequency;
|
|
23
|
+
uniform float uWarpSpeed;
|
|
24
|
+
uniform float uWarpAmplitude;
|
|
25
|
+
uniform float uBlendAngle;
|
|
26
|
+
uniform float uBlendSoftness;
|
|
27
|
+
uniform float uRotationAmount;
|
|
28
|
+
uniform float uNoiseScale;
|
|
29
|
+
uniform float uGrainAmount;
|
|
30
|
+
uniform float uGrainScale;
|
|
31
|
+
uniform float uGrainAnimated;
|
|
32
|
+
uniform float uContrast;
|
|
33
|
+
uniform float uGamma;
|
|
34
|
+
uniform float uSaturation;
|
|
35
|
+
uniform vec2 uCenterOffset;
|
|
36
|
+
uniform float uZoom;
|
|
37
|
+
uniform vec3 uColor1;
|
|
38
|
+
uniform vec3 uColor2;
|
|
39
|
+
uniform vec3 uColor3;
|
|
40
|
+
uniform float uLightMode;
|
|
41
|
+
out vec4 fragColor;
|
|
42
|
+
#define S(a,b,t) smoothstep(a,b,t)
|
|
43
|
+
mat2 Rot(float a){float s=sin(a),c=cos(a);return mat2(c,-s,s,c);}
|
|
44
|
+
vec2 hash(vec2 p){p=vec2(dot(p,vec2(2127.1,81.17)),dot(p,vec2(1269.5,283.37)));return fract(sin(p)*43758.5453);}
|
|
45
|
+
float noise(vec2 p){vec2 i=floor(p),f=fract(p),u=f*f*(3.0-2.0*f);float n=mix(mix(dot(-1.0+2.0*hash(i+vec2(0.0,0.0)),f-vec2(0.0,0.0)),dot(-1.0+2.0*hash(i+vec2(1.0,0.0)),f-vec2(1.0,0.0)),u.x),mix(dot(-1.0+2.0*hash(i+vec2(0.0,1.0)),f-vec2(0.0,1.0)),dot(-1.0+2.0*hash(i+vec2(1.0,1.0)),f-vec2(1.0,1.0)),u.x),u.y);return 0.5+0.5*n;}
|
|
46
|
+
void mainImage(out vec4 o, vec2 C){
|
|
47
|
+
float t=iTime*uTimeSpeed;
|
|
48
|
+
vec2 uv=C/iResolution.xy;
|
|
49
|
+
float ratio=iResolution.x/iResolution.y;
|
|
50
|
+
vec2 tuv=uv-0.5+uCenterOffset;
|
|
51
|
+
tuv/=max(uZoom,0.001);
|
|
52
|
+
|
|
53
|
+
float degree=noise(vec2(t*0.1,tuv.x*tuv.y)*uNoiseScale);
|
|
54
|
+
tuv.y*=1.0/ratio;
|
|
55
|
+
tuv*=Rot(radians((degree-0.5)*uRotationAmount+180.0));
|
|
56
|
+
tuv.y*=ratio;
|
|
57
|
+
|
|
58
|
+
float frequency=uWarpFrequency;
|
|
59
|
+
float ws=max(uWarpStrength,0.001);
|
|
60
|
+
float amplitude=uWarpAmplitude/ws;
|
|
61
|
+
float warpTime=t*uWarpSpeed;
|
|
62
|
+
tuv.x+=sin(tuv.y*frequency+warpTime)/amplitude;
|
|
63
|
+
tuv.y+=sin(tuv.x*(frequency*1.5)+warpTime)/(amplitude*0.5);
|
|
64
|
+
|
|
65
|
+
vec3 colLav=uColor1;
|
|
66
|
+
vec3 colOrg=uColor2;
|
|
67
|
+
vec3 colDark=uColor3;
|
|
68
|
+
float b=uColorBalance;
|
|
69
|
+
float s=max(uBlendSoftness,0.0);
|
|
70
|
+
mat2 blendRot=Rot(radians(uBlendAngle));
|
|
71
|
+
float blendX=(tuv*blendRot).x;
|
|
72
|
+
float edge0=-0.3-b-s;
|
|
73
|
+
float edge1=0.2-b+s;
|
|
74
|
+
float v0=0.5-b+s;
|
|
75
|
+
float v1=-0.3-b-s;
|
|
76
|
+
vec3 layer1=mix(colDark,colOrg,S(edge0,edge1,blendX));
|
|
77
|
+
vec3 layer2=mix(colOrg,colLav,S(edge0,edge1,blendX));
|
|
78
|
+
vec3 col=mix(layer1,layer2,S(v0,v1,tuv.y));
|
|
79
|
+
|
|
80
|
+
vec2 grainUv=uv*max(uGrainScale,0.001);
|
|
81
|
+
if(uGrainAnimated>0.5){grainUv+=vec2(iTime*0.05);}
|
|
82
|
+
float grain=fract(sin(dot(grainUv,vec2(12.9898,78.233)))*43758.5453);
|
|
83
|
+
col+=(grain-0.5)*uGrainAmount;
|
|
84
|
+
|
|
85
|
+
col=(col-0.5)*uContrast+0.5;
|
|
86
|
+
float luma=dot(col,vec3(0.2126,0.7152,0.0722));
|
|
87
|
+
col=mix(vec3(luma),col,uSaturation);
|
|
88
|
+
col=pow(max(col,0.0),vec3(1.0/max(uGamma,0.001)));
|
|
89
|
+
col=clamp(col,0.0,1.0);
|
|
90
|
+
if(uLightMode>0.5){
|
|
91
|
+
float energy=max(max(col.r,col.g),col.b);
|
|
92
|
+
vec3 hue=col/max(energy,0.001);
|
|
93
|
+
float chroma=length(col-vec3(dot(col,vec3(0.333333))));
|
|
94
|
+
float coverage=clamp(0.12+chroma*1.15+energy*0.18,0.0,0.88);
|
|
95
|
+
col=mix(vec3(1.0),clamp(hue*0.58+col*0.18,0.0,1.0),coverage);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
o=vec4(col,1.0);
|
|
99
|
+
}
|
|
100
|
+
void main(){
|
|
101
|
+
vec4 o=vec4(0.0);
|
|
102
|
+
mainImage(o,gl_FragCoord.xy);
|
|
103
|
+
fragColor=o;
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
const hexToRgb = (hex) => {
|
|
107
|
+
let value = hex.trim().replace("#", "");
|
|
108
|
+
if (value.length === 3) value = [...value].map((c) => c + c).join("");
|
|
109
|
+
const result = /^([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(value);
|
|
110
|
+
if (!result) return [
|
|
111
|
+
1,
|
|
112
|
+
1,
|
|
113
|
+
1
|
|
114
|
+
];
|
|
115
|
+
return [
|
|
116
|
+
Number.parseInt(result[1], 16) / 255,
|
|
117
|
+
Number.parseInt(result[2], 16) / 255,
|
|
118
|
+
Number.parseInt(result[3], 16) / 255
|
|
119
|
+
];
|
|
120
|
+
};
|
|
121
|
+
const compile = (gl, type, source) => {
|
|
122
|
+
const shader = gl.createShader(type);
|
|
123
|
+
if (!shader) return null;
|
|
124
|
+
gl.shaderSource(shader, source);
|
|
125
|
+
gl.compileShader(shader);
|
|
126
|
+
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
|
127
|
+
gl.deleteShader(shader);
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return shader;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Animated grainy gradient (WebGL2, no extra dependency). Fills its nearest positioned ancestor,
|
|
134
|
+
* pauses when off-screen or the tab is hidden, and draws one still frame when reduced motion is
|
|
135
|
+
* preferred. Without WebGL2 it renders nothing, so give the parent a fallback background.
|
|
136
|
+
*/
|
|
137
|
+
const Grainient = memo(({ timeSpeed = .25, colorBalance = 0, warpStrength = 1, warpFrequency = 5, warpSpeed = 2, warpAmplitude = 50, blendAngle = 0, blendSoftness = .05, rotationAmount = 500, noiseScale = 2, grainAmount = .1, grainScale = 2, contrast = 1.5, gamma = 1, saturation = 1, zoom = .9, centerX = 0, centerY = 0, color1 = "#FF9FFC", color2 = "#5227FF", color3 = "#B497CF", grainAnimated = false, lightMode = false, className, style, ...rest }) => {
|
|
138
|
+
const containerRef = useRef(null);
|
|
139
|
+
const drawRef = useRef(null);
|
|
140
|
+
const uniformsRef = useRef(null);
|
|
141
|
+
const { isDarkMode } = useThemeMode();
|
|
142
|
+
const light = lightMode === "auto" ? !isDarkMode : lightMode;
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
const container = containerRef.current;
|
|
145
|
+
if (!container) return;
|
|
146
|
+
const canvas = document.createElement("canvas");
|
|
147
|
+
canvas.className = stylex.props(styles.canvas).className ?? "";
|
|
148
|
+
const gl = canvas.getContext("webgl2", {
|
|
149
|
+
alpha: true,
|
|
150
|
+
antialias: false
|
|
151
|
+
});
|
|
152
|
+
if (!gl) return;
|
|
153
|
+
container.append(canvas);
|
|
154
|
+
const vs = compile(gl, gl.VERTEX_SHADER, VERTEX_SHADER);
|
|
155
|
+
const fs = compile(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);
|
|
156
|
+
const program = gl.createProgram();
|
|
157
|
+
if (!vs || !fs || !program) {
|
|
158
|
+
canvas.remove();
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
gl.attachShader(program, vs);
|
|
162
|
+
gl.attachShader(program, fs);
|
|
163
|
+
gl.linkProgram(program);
|
|
164
|
+
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
|
165
|
+
canvas.remove();
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
gl.useProgram(program);
|
|
169
|
+
const buffer = gl.createBuffer();
|
|
170
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
171
|
+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
|
172
|
+
-1,
|
|
173
|
+
-1,
|
|
174
|
+
3,
|
|
175
|
+
-1,
|
|
176
|
+
-1,
|
|
177
|
+
3
|
|
178
|
+
]), gl.STATIC_DRAW);
|
|
179
|
+
const position = gl.getAttribLocation(program, "position");
|
|
180
|
+
gl.enableVertexAttribArray(position);
|
|
181
|
+
gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);
|
|
182
|
+
const loc = (name) => gl.getUniformLocation(program, name);
|
|
183
|
+
const uTime = loc("iTime");
|
|
184
|
+
const uRes = loc("iResolution");
|
|
185
|
+
const started = performance.now();
|
|
186
|
+
const draw = () => {
|
|
187
|
+
gl.uniform1f(uTime, (performance.now() - started) * .001);
|
|
188
|
+
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
|
189
|
+
};
|
|
190
|
+
drawRef.current = draw;
|
|
191
|
+
uniformsRef.current?.();
|
|
192
|
+
const setSize = () => {
|
|
193
|
+
const rect = container.getBoundingClientRect();
|
|
194
|
+
const dpr = Math.min(window.devicePixelRatio || 1, 2);
|
|
195
|
+
canvas.width = Math.max(1, Math.floor(rect.width * dpr));
|
|
196
|
+
canvas.height = Math.max(1, Math.floor(rect.height * dpr));
|
|
197
|
+
gl.viewport(0, 0, canvas.width, canvas.height);
|
|
198
|
+
gl.uniform2f(uRes, canvas.width, canvas.height);
|
|
199
|
+
draw();
|
|
200
|
+
};
|
|
201
|
+
const reducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)");
|
|
202
|
+
let raf = 0;
|
|
203
|
+
let inView = true;
|
|
204
|
+
const loop = () => {
|
|
205
|
+
draw();
|
|
206
|
+
raf = requestAnimationFrame(loop);
|
|
207
|
+
};
|
|
208
|
+
const stop = () => {
|
|
209
|
+
if (raf) cancelAnimationFrame(raf);
|
|
210
|
+
raf = 0;
|
|
211
|
+
};
|
|
212
|
+
const sync = () => {
|
|
213
|
+
const run = inView && !document.hidden && !reducedMotion?.matches;
|
|
214
|
+
if (run && !raf) raf = requestAnimationFrame(loop);
|
|
215
|
+
if (!run) {
|
|
216
|
+
stop();
|
|
217
|
+
draw();
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const resizeObserver = new ResizeObserver(setSize);
|
|
221
|
+
resizeObserver.observe(container);
|
|
222
|
+
const intersectionObserver = new IntersectionObserver(([entry]) => {
|
|
223
|
+
inView = entry.isIntersecting;
|
|
224
|
+
sync();
|
|
225
|
+
});
|
|
226
|
+
intersectionObserver.observe(container);
|
|
227
|
+
document.addEventListener("visibilitychange", sync);
|
|
228
|
+
reducedMotion?.addEventListener("change", sync);
|
|
229
|
+
setSize();
|
|
230
|
+
sync();
|
|
231
|
+
return () => {
|
|
232
|
+
stop();
|
|
233
|
+
resizeObserver.disconnect();
|
|
234
|
+
intersectionObserver.disconnect();
|
|
235
|
+
document.removeEventListener("visibilitychange", sync);
|
|
236
|
+
reducedMotion?.removeEventListener("change", sync);
|
|
237
|
+
drawRef.current = null;
|
|
238
|
+
gl.deleteBuffer(buffer);
|
|
239
|
+
gl.deleteProgram(program);
|
|
240
|
+
gl.deleteShader(vs);
|
|
241
|
+
gl.deleteShader(fs);
|
|
242
|
+
canvas.remove();
|
|
243
|
+
};
|
|
244
|
+
}, []);
|
|
245
|
+
useEffect(() => {
|
|
246
|
+
const apply = () => {
|
|
247
|
+
const gl = (containerRef.current?.querySelector("canvas"))?.getContext("webgl2");
|
|
248
|
+
if (!gl) return;
|
|
249
|
+
const program = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
250
|
+
if (!program) return;
|
|
251
|
+
const loc = (name) => gl.getUniformLocation(program, name);
|
|
252
|
+
gl.uniform1f(loc("uTimeSpeed"), timeSpeed);
|
|
253
|
+
gl.uniform1f(loc("uColorBalance"), colorBalance);
|
|
254
|
+
gl.uniform1f(loc("uWarpStrength"), warpStrength);
|
|
255
|
+
gl.uniform1f(loc("uWarpFrequency"), warpFrequency);
|
|
256
|
+
gl.uniform1f(loc("uWarpSpeed"), warpSpeed);
|
|
257
|
+
gl.uniform1f(loc("uWarpAmplitude"), warpAmplitude);
|
|
258
|
+
gl.uniform1f(loc("uBlendAngle"), blendAngle);
|
|
259
|
+
gl.uniform1f(loc("uBlendSoftness"), blendSoftness);
|
|
260
|
+
gl.uniform1f(loc("uRotationAmount"), rotationAmount);
|
|
261
|
+
gl.uniform1f(loc("uNoiseScale"), noiseScale);
|
|
262
|
+
gl.uniform1f(loc("uGrainAmount"), grainAmount);
|
|
263
|
+
gl.uniform1f(loc("uGrainScale"), grainScale);
|
|
264
|
+
gl.uniform1f(loc("uContrast"), contrast);
|
|
265
|
+
gl.uniform1f(loc("uGamma"), gamma);
|
|
266
|
+
gl.uniform1f(loc("uSaturation"), saturation);
|
|
267
|
+
gl.uniform1f(loc("uZoom"), zoom);
|
|
268
|
+
gl.uniform1f(loc("uGrainAnimated"), grainAnimated ? 1 : 0);
|
|
269
|
+
gl.uniform1f(loc("uLightMode"), light ? 1 : 0);
|
|
270
|
+
gl.uniform2f(loc("uCenterOffset"), centerX, centerY);
|
|
271
|
+
gl.uniform3f(loc("uColor1"), ...hexToRgb(color1));
|
|
272
|
+
gl.uniform3f(loc("uColor2"), ...hexToRgb(color2));
|
|
273
|
+
gl.uniform3f(loc("uColor3"), ...hexToRgb(color3));
|
|
274
|
+
drawRef.current?.();
|
|
275
|
+
};
|
|
276
|
+
uniformsRef.current = apply;
|
|
277
|
+
apply();
|
|
278
|
+
}, [
|
|
279
|
+
timeSpeed,
|
|
280
|
+
colorBalance,
|
|
281
|
+
warpStrength,
|
|
282
|
+
warpFrequency,
|
|
283
|
+
warpSpeed,
|
|
284
|
+
warpAmplitude,
|
|
285
|
+
blendAngle,
|
|
286
|
+
blendSoftness,
|
|
287
|
+
rotationAmount,
|
|
288
|
+
noiseScale,
|
|
289
|
+
grainAmount,
|
|
290
|
+
grainScale,
|
|
291
|
+
contrast,
|
|
292
|
+
gamma,
|
|
293
|
+
saturation,
|
|
294
|
+
zoom,
|
|
295
|
+
centerX,
|
|
296
|
+
centerY,
|
|
297
|
+
color1,
|
|
298
|
+
color2,
|
|
299
|
+
color3,
|
|
300
|
+
grainAnimated,
|
|
301
|
+
light
|
|
302
|
+
]);
|
|
303
|
+
return /* @__PURE__ */ jsx("div", {
|
|
304
|
+
"aria-hidden": true,
|
|
305
|
+
ref: containerRef,
|
|
306
|
+
...rest,
|
|
307
|
+
...styleProps(styles.root, className, style)
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
Grainient.displayName = "Grainient";
|
|
311
|
+
//#endregion
|
|
312
|
+
export { Grainient as default, hexToRgb };
|
|
313
|
+
|
|
314
|
+
//# sourceMappingURL=Grainient.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grainient.mjs","names":[],"sources":["../../../src/awesome/Grainient/Grainient.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { memo, useEffect, useRef } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\nimport { useThemeMode } from '@/styles/theme/scope';\n\nimport { styles } from './style';\nimport type { GrainientProps } from './type';\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 position;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n}\n`;\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\nuniform vec2 iResolution;\nuniform float iTime;\nuniform float uTimeSpeed;\nuniform float uColorBalance;\nuniform float uWarpStrength;\nuniform float uWarpFrequency;\nuniform float uWarpSpeed;\nuniform float uWarpAmplitude;\nuniform float uBlendAngle;\nuniform float uBlendSoftness;\nuniform float uRotationAmount;\nuniform float uNoiseScale;\nuniform float uGrainAmount;\nuniform float uGrainScale;\nuniform float uGrainAnimated;\nuniform float uContrast;\nuniform float uGamma;\nuniform float uSaturation;\nuniform vec2 uCenterOffset;\nuniform float uZoom;\nuniform vec3 uColor1;\nuniform vec3 uColor2;\nuniform vec3 uColor3;\nuniform float uLightMode;\nout vec4 fragColor;\n#define S(a,b,t) smoothstep(a,b,t)\nmat2 Rot(float a){float s=sin(a),c=cos(a);return mat2(c,-s,s,c);}\nvec2 hash(vec2 p){p=vec2(dot(p,vec2(2127.1,81.17)),dot(p,vec2(1269.5,283.37)));return fract(sin(p)*43758.5453);}\nfloat noise(vec2 p){vec2 i=floor(p),f=fract(p),u=f*f*(3.0-2.0*f);float n=mix(mix(dot(-1.0+2.0*hash(i+vec2(0.0,0.0)),f-vec2(0.0,0.0)),dot(-1.0+2.0*hash(i+vec2(1.0,0.0)),f-vec2(1.0,0.0)),u.x),mix(dot(-1.0+2.0*hash(i+vec2(0.0,1.0)),f-vec2(0.0,1.0)),dot(-1.0+2.0*hash(i+vec2(1.0,1.0)),f-vec2(1.0,1.0)),u.x),u.y);return 0.5+0.5*n;}\nvoid mainImage(out vec4 o, vec2 C){\n float t=iTime*uTimeSpeed;\n vec2 uv=C/iResolution.xy;\n float ratio=iResolution.x/iResolution.y;\n vec2 tuv=uv-0.5+uCenterOffset;\n tuv/=max(uZoom,0.001);\n\n float degree=noise(vec2(t*0.1,tuv.x*tuv.y)*uNoiseScale);\n tuv.y*=1.0/ratio;\n tuv*=Rot(radians((degree-0.5)*uRotationAmount+180.0));\n tuv.y*=ratio;\n\n float frequency=uWarpFrequency;\n float ws=max(uWarpStrength,0.001);\n float amplitude=uWarpAmplitude/ws;\n float warpTime=t*uWarpSpeed;\n tuv.x+=sin(tuv.y*frequency+warpTime)/amplitude;\n tuv.y+=sin(tuv.x*(frequency*1.5)+warpTime)/(amplitude*0.5);\n\n vec3 colLav=uColor1;\n vec3 colOrg=uColor2;\n vec3 colDark=uColor3;\n float b=uColorBalance;\n float s=max(uBlendSoftness,0.0);\n mat2 blendRot=Rot(radians(uBlendAngle));\n float blendX=(tuv*blendRot).x;\n float edge0=-0.3-b-s;\n float edge1=0.2-b+s;\n float v0=0.5-b+s;\n float v1=-0.3-b-s;\n vec3 layer1=mix(colDark,colOrg,S(edge0,edge1,blendX));\n vec3 layer2=mix(colOrg,colLav,S(edge0,edge1,blendX));\n vec3 col=mix(layer1,layer2,S(v0,v1,tuv.y));\n\n vec2 grainUv=uv*max(uGrainScale,0.001);\n if(uGrainAnimated>0.5){grainUv+=vec2(iTime*0.05);}\n float grain=fract(sin(dot(grainUv,vec2(12.9898,78.233)))*43758.5453);\n col+=(grain-0.5)*uGrainAmount;\n\n col=(col-0.5)*uContrast+0.5;\n float luma=dot(col,vec3(0.2126,0.7152,0.0722));\n col=mix(vec3(luma),col,uSaturation);\n col=pow(max(col,0.0),vec3(1.0/max(uGamma,0.001)));\n col=clamp(col,0.0,1.0);\n if(uLightMode>0.5){\n float energy=max(max(col.r,col.g),col.b);\n vec3 hue=col/max(energy,0.001);\n float chroma=length(col-vec3(dot(col,vec3(0.333333))));\n float coverage=clamp(0.12+chroma*1.15+energy*0.18,0.0,0.88);\n col=mix(vec3(1.0),clamp(hue*0.58+col*0.18,0.0,1.0),coverage);\n }\n\n o=vec4(col,1.0);\n}\nvoid main(){\n vec4 o=vec4(0.0);\n mainImage(o,gl_FragCoord.xy);\n fragColor=o;\n}\n`;\n\nexport const hexToRgb = (hex: string): [number, number, number] => {\n let value = hex.trim().replace('#', '');\n if (value.length === 3) value = [...value].map((c) => c + c).join('');\n const result = /^([\\da-f]{2})([\\da-f]{2})([\\da-f]{2})$/i.exec(value);\n if (!result) return [1, 1, 1];\n return [\n Number.parseInt(result[1], 16) / 255,\n Number.parseInt(result[2], 16) / 255,\n Number.parseInt(result[3], 16) / 255,\n ];\n};\n\nconst compile = (gl: WebGL2RenderingContext, type: number, source: string) => {\n const shader = gl.createShader(type);\n if (!shader) return null;\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n gl.deleteShader(shader);\n return null;\n }\n return shader;\n};\n\n/**\n * Animated grainy gradient (WebGL2, no extra dependency). Fills its nearest positioned ancestor,\n * pauses when off-screen or the tab is hidden, and draws one still frame when reduced motion is\n * preferred. Without WebGL2 it renders nothing, so give the parent a fallback background.\n */\nconst Grainient = memo<GrainientProps>(\n ({\n timeSpeed = 0.25,\n colorBalance = 0,\n warpStrength = 1,\n warpFrequency = 5,\n warpSpeed = 2,\n warpAmplitude = 50,\n blendAngle = 0,\n blendSoftness = 0.05,\n rotationAmount = 500,\n noiseScale = 2,\n grainAmount = 0.1,\n grainScale = 2,\n contrast = 1.5,\n gamma = 1,\n saturation = 1,\n zoom = 0.9,\n centerX = 0,\n centerY = 0,\n color1 = '#FF9FFC',\n color2 = '#5227FF',\n color3 = '#B497CF',\n grainAnimated = false,\n lightMode = false,\n className,\n style,\n ...rest\n }) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const drawRef = useRef<(() => void) | null>(null);\n const uniformsRef = useRef<(() => void) | null>(null);\n const { isDarkMode } = useThemeMode();\n const light = lightMode === 'auto' ? !isDarkMode : lightMode;\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n const canvas = document.createElement('canvas');\n canvas.className = stylex.props(styles.canvas).className ?? '';\n const gl = canvas.getContext('webgl2', { alpha: true, antialias: false });\n if (!gl) return;\n container.append(canvas);\n\n const vs = compile(gl, gl.VERTEX_SHADER, VERTEX_SHADER);\n const fs = compile(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);\n const program = gl.createProgram();\n if (!vs || !fs || !program) {\n canvas.remove();\n return;\n }\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n canvas.remove();\n return;\n }\n gl.useProgram(program);\n\n // One triangle that covers the viewport.\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);\n const position = gl.getAttribLocation(program, 'position');\n gl.enableVertexAttribArray(position);\n gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);\n\n const loc = (name: string) => gl.getUniformLocation(program, name);\n const uTime = loc('iTime');\n const uRes = loc('iResolution');\n const started = performance.now();\n\n const draw = () => {\n gl.uniform1f(uTime, (performance.now() - started) * 0.001);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n };\n drawRef.current = draw;\n uniformsRef.current?.();\n\n const setSize = () => {\n const rect = container.getBoundingClientRect();\n const dpr = Math.min(window.devicePixelRatio || 1, 2);\n canvas.width = Math.max(1, Math.floor(rect.width * dpr));\n canvas.height = Math.max(1, Math.floor(rect.height * dpr));\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.uniform2f(uRes, canvas.width, canvas.height);\n draw();\n };\n\n const reducedMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)');\n let raf = 0;\n let inView = true;\n\n const loop = () => {\n draw();\n raf = requestAnimationFrame(loop);\n };\n const stop = () => {\n if (raf) cancelAnimationFrame(raf);\n raf = 0;\n };\n const sync = () => {\n const run = inView && !document.hidden && !reducedMotion?.matches;\n if (run && !raf) raf = requestAnimationFrame(loop);\n if (!run) {\n stop();\n draw();\n }\n };\n\n const resizeObserver = new ResizeObserver(setSize);\n resizeObserver.observe(container);\n const intersectionObserver = new IntersectionObserver(([entry]) => {\n inView = entry.isIntersecting;\n sync();\n });\n intersectionObserver.observe(container);\n document.addEventListener('visibilitychange', sync);\n reducedMotion?.addEventListener('change', sync);\n setSize();\n sync();\n\n return () => {\n stop();\n resizeObserver.disconnect();\n intersectionObserver.disconnect();\n document.removeEventListener('visibilitychange', sync);\n reducedMotion?.removeEventListener('change', sync);\n drawRef.current = null;\n gl.deleteBuffer(buffer);\n gl.deleteProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n canvas.remove();\n };\n }, []);\n\n useEffect(() => {\n const apply = () => {\n const canvas = containerRef.current?.querySelector('canvas');\n const gl = canvas?.getContext('webgl2');\n if (!gl) return;\n const program = gl.getParameter(gl.CURRENT_PROGRAM) as WebGLProgram | null;\n if (!program) return;\n const loc = (name: string) => gl.getUniformLocation(program, name);\n gl.uniform1f(loc('uTimeSpeed'), timeSpeed);\n gl.uniform1f(loc('uColorBalance'), colorBalance);\n gl.uniform1f(loc('uWarpStrength'), warpStrength);\n gl.uniform1f(loc('uWarpFrequency'), warpFrequency);\n gl.uniform1f(loc('uWarpSpeed'), warpSpeed);\n gl.uniform1f(loc('uWarpAmplitude'), warpAmplitude);\n gl.uniform1f(loc('uBlendAngle'), blendAngle);\n gl.uniform1f(loc('uBlendSoftness'), blendSoftness);\n gl.uniform1f(loc('uRotationAmount'), rotationAmount);\n gl.uniform1f(loc('uNoiseScale'), noiseScale);\n gl.uniform1f(loc('uGrainAmount'), grainAmount);\n gl.uniform1f(loc('uGrainScale'), grainScale);\n gl.uniform1f(loc('uContrast'), contrast);\n gl.uniform1f(loc('uGamma'), gamma);\n gl.uniform1f(loc('uSaturation'), saturation);\n gl.uniform1f(loc('uZoom'), zoom);\n gl.uniform1f(loc('uGrainAnimated'), grainAnimated ? 1 : 0);\n gl.uniform1f(loc('uLightMode'), light ? 1 : 0);\n gl.uniform2f(loc('uCenterOffset'), centerX, centerY);\n gl.uniform3f(loc('uColor1'), ...hexToRgb(color1));\n gl.uniform3f(loc('uColor2'), ...hexToRgb(color2));\n gl.uniform3f(loc('uColor3'), ...hexToRgb(color3));\n drawRef.current?.();\n };\n uniformsRef.current = apply;\n apply();\n }, [\n timeSpeed,\n colorBalance,\n warpStrength,\n warpFrequency,\n warpSpeed,\n warpAmplitude,\n blendAngle,\n blendSoftness,\n rotationAmount,\n noiseScale,\n grainAmount,\n grainScale,\n contrast,\n gamma,\n saturation,\n zoom,\n centerX,\n centerY,\n color1,\n color2,\n color3,\n grainAnimated,\n light,\n ]);\n\n return (\n <div\n aria-hidden\n ref={containerRef}\n {...rest}\n {...styleProps(styles.root, className, style)}\n />\n );\n },\n);\n\nGrainient.displayName = 'Grainient';\n\nexport default Grainient;\n"],"mappings":";;;;;;;;AAQA,MAAM,gBAAg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I,gBAAgB,GAAG,gBAAgB,IAAI,CAAC;GACzD,GAAG,UAAU,IAAI,YAAY,GAAG,QAAQ,IAAI,CAAC;GAC7C,GAAG,UAAU,IAAI,eAAe,GAAG,SAAS,OAAO;GACnD,GAAG,UAAU,IAAI,SAAS,GAAG,GAAG,SAAS,MAAM,CAAC;GAChD,GAAG,UAAU,IAAI,SAAS,GAAG,GAAG,SAAS,MAAM,CAAC;GAChD,GAAG,UAAU,IAAI,SAAS,GAAG,GAAG,SAAS,MAAM,CAAC;GAChD,QAAQ,UAAU;EACpB;EACA,YAAY,UAAU;EACtB,MAAM;CACR,GAAG;EAAC;EAAW;EAAc;EAAc;EAAe;EAAW;EAAe;EAAY;EAAe;EAAgB;EAAY;EAAa;EAAY;EAAU;EAAO;EAAY;EAAM;EAAS;EAAS;EAAQ;EAAQ;EAAQ;EAAe;CAAK,CAAC;CACtQ,OAAO,oBAAC,OAAD;EAAK,eAAA;EAAY,KAAK;EAAc,GAAI;EAAM,GAAI,WAAW,OAAO,MAAM,WAAW,KAAK;CAAI,CAAA;AACvG,CAAC;AACD,UAAU,cAAc"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/awesome/Grainient/style.ts
|
|
2
|
+
const styles = {
|
|
3
|
+
canvas: {
|
|
4
|
+
kpwlN0: "lb10a8y8t",
|
|
5
|
+
kZKoxP: "lb5yr21d",
|
|
6
|
+
k1xSpc: "lb1lliihq",
|
|
7
|
+
kzqmXN: "lbh8yej3",
|
|
8
|
+
kVAEAm: "lb10l6tqk",
|
|
9
|
+
$$css: true
|
|
10
|
+
},
|
|
11
|
+
root: {
|
|
12
|
+
kpwlN0: "lb10a8y8t",
|
|
13
|
+
kVQacm: "lbb3r6kr",
|
|
14
|
+
kfzvcC: "lb47corl",
|
|
15
|
+
kVAEAm: "lb10l6tqk",
|
|
16
|
+
kY2c9j: "lb1ja2u2z",
|
|
17
|
+
$$css: true
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { styles };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/awesome/Grainient/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nexport const styles = stylex.create({\n canvas: {\n inset: 0,\n blockSize: '100%',\n display: 'block',\n inlineSize: '100%',\n position: 'absolute',\n },\n root: {\n inset: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 0,\n },\n});\n"],"mappings":";AACA,MAAa,SAAS;CACpB,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { DivProps } from "../../types/index.mjs";
|
|
2
|
+
//#region src/awesome/Grainient/type.d.ts
|
|
3
|
+
export interface GrainientProps extends DivProps {
|
|
4
|
+
/**
|
|
5
|
+
* Angle of the color blend, in degrees.
|
|
6
|
+
* @default 0
|
|
7
|
+
*/
|
|
8
|
+
blendAngle?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Softness of the color edges.
|
|
11
|
+
* @default 0.05
|
|
12
|
+
*/
|
|
13
|
+
blendSoftness?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Horizontal offset of the field center.
|
|
16
|
+
* @default 0
|
|
17
|
+
*/
|
|
18
|
+
centerX?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Vertical offset of the field center.
|
|
21
|
+
* @default 0
|
|
22
|
+
*/
|
|
23
|
+
centerY?: number;
|
|
24
|
+
/**
|
|
25
|
+
* First color stop, as hex.
|
|
26
|
+
* @default '#FF9FFC'
|
|
27
|
+
*/
|
|
28
|
+
color1?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Second color stop, as hex.
|
|
31
|
+
* @default '#5227FF'
|
|
32
|
+
*/
|
|
33
|
+
color2?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Third color stop, as hex.
|
|
36
|
+
* @default '#B497CF'
|
|
37
|
+
*/
|
|
38
|
+
color3?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Shifts the blend toward color1 (negative) or color3 (positive).
|
|
41
|
+
* @default 0
|
|
42
|
+
*/
|
|
43
|
+
colorBalance?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Output contrast.
|
|
46
|
+
* @default 1.5
|
|
47
|
+
*/
|
|
48
|
+
contrast?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Output gamma.
|
|
51
|
+
* @default 1
|
|
52
|
+
*/
|
|
53
|
+
gamma?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Film grain strength. 0 turns it off.
|
|
56
|
+
* @default 0.1
|
|
57
|
+
*/
|
|
58
|
+
grainAmount?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Animate the grain with time.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
grainAnimated?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Film grain scale.
|
|
66
|
+
* @default 2
|
|
67
|
+
*/
|
|
68
|
+
grainScale?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Wash the colors toward white for a light surface. `'auto'` follows the current theme.
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
lightMode?: boolean | 'auto';
|
|
74
|
+
/**
|
|
75
|
+
* Scale of the rotation noise.
|
|
76
|
+
* @default 2
|
|
77
|
+
*/
|
|
78
|
+
noiseScale?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Noise-driven rotation, in degrees.
|
|
81
|
+
* @default 500
|
|
82
|
+
*/
|
|
83
|
+
rotationAmount?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Output saturation.
|
|
86
|
+
* @default 1
|
|
87
|
+
*/
|
|
88
|
+
saturation?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Animation speed. A still frame is drawn when reduced motion is preferred.
|
|
91
|
+
* @default 0.25
|
|
92
|
+
*/
|
|
93
|
+
timeSpeed?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Warp amplitude divisor; higher is calmer.
|
|
96
|
+
* @default 50
|
|
97
|
+
*/
|
|
98
|
+
warpAmplitude?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Frequency of the warp waves.
|
|
101
|
+
* @default 5
|
|
102
|
+
*/
|
|
103
|
+
warpFrequency?: number;
|
|
104
|
+
/**
|
|
105
|
+
* Speed of the warp waves.
|
|
106
|
+
* @default 2
|
|
107
|
+
*/
|
|
108
|
+
warpSpeed?: number;
|
|
109
|
+
/**
|
|
110
|
+
* How strongly the field is warped.
|
|
111
|
+
* @default 1
|
|
112
|
+
*/
|
|
113
|
+
warpStrength?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Zoom of the field.
|
|
116
|
+
* @default 0.9
|
|
117
|
+
*/
|
|
118
|
+
zoom?: number;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//# sourceMappingURL=type.d.mts.map
|
package/es/awesome/index.d.mts
CHANGED
|
@@ -35,6 +35,9 @@ import "./Giscus/index.mjs";
|
|
|
35
35
|
import { GradientButtonProps } from "./GradientButton/type.mjs";
|
|
36
36
|
import GradientButton from "./GradientButton/GradientButton.mjs";
|
|
37
37
|
import "./GradientButton/index.mjs";
|
|
38
|
+
import { GrainientProps } from "./Grainient/type.mjs";
|
|
39
|
+
import Grainient from "./Grainient/Grainient.mjs";
|
|
40
|
+
import "./Grainient/index.mjs";
|
|
38
41
|
import { GridBackgroundProps, GridShowcaseProps } from "./GridBackground/type.mjs";
|
|
39
42
|
import GridBackground from "./GridBackground/GridBackground.mjs";
|
|
40
43
|
import GridShowcase from "./GridBackground/GridShowcase.mjs";
|
|
@@ -64,4 +67,4 @@ import "./Spotlight/index.mjs";
|
|
|
64
67
|
import { CursorStyle, SegmentMode, TypewriterEffectProps } from "./TypewriterEffect/type.mjs";
|
|
65
68
|
import TypewriterEffect from "./TypewriterEffect/TypewriterEffect.mjs";
|
|
66
69
|
import "./TypewriterEffect/index.mjs";
|
|
67
|
-
export { AgentSkillCard, type AgentSkillCardAgent, type AgentSkillCardMode, type AgentSkillCardPanel, type AgentSkillCardProps, AuroraBackground, type AuroraBackgroundProps, BentoCard, type BentoCardProps, BentoGrid, type BentoGridProps, BottomGradientButton, type BottomGradientButtonProps, CodeShowcase, type CodeShowcaseItem, type CodeShowcaseProps, type CursorStyle, DEFAULT_SKILL_AGENTS, FeatureGrid, type FeatureGridItem, type FeatureGridProps, type FeatureItemType, Features, type FeaturesProps, FluidGradient, type FluidGradientProps, Giscus, type GiscusProps, GradientButton, type GradientButtonProps, GridBackground, type GridBackgroundProps, GridShowcase, type GridShowcaseProps, Hero, type HeroAction, type HeroProps, InstallBanner, type InstallBannerProps, LANDING_GRADIENT_VAR, LANDING_PALETTE_DARK, LANDING_PALETTE_LIGHT, type LandingAction, LandingHero, type LandingHeroAction, type LandingHeroProps, type LandingLinkProps, type LandingLinkRender, type LandingNavigate, type LandingPalette, LandingSection, type LandingSectionProps, LogoMarquee, type LogoMarqueeItem, type LogoMarqueeProps, type SegmentMode, Spline, type SplineProps, Spotlight, SpotlightCard, type SpotlightCardProps, type SpotlightProps, TypewriterEffect, type TypewriterEffectProps, accentGradient as landingAccentGradient };
|
|
70
|
+
export { AgentSkillCard, type AgentSkillCardAgent, type AgentSkillCardMode, type AgentSkillCardPanel, type AgentSkillCardProps, AuroraBackground, type AuroraBackgroundProps, BentoCard, type BentoCardProps, BentoGrid, type BentoGridProps, BottomGradientButton, type BottomGradientButtonProps, CodeShowcase, type CodeShowcaseItem, type CodeShowcaseProps, type CursorStyle, DEFAULT_SKILL_AGENTS, FeatureGrid, type FeatureGridItem, type FeatureGridProps, type FeatureItemType, Features, type FeaturesProps, FluidGradient, type FluidGradientProps, Giscus, type GiscusProps, GradientButton, type GradientButtonProps, Grainient, type GrainientProps, GridBackground, type GridBackgroundProps, GridShowcase, type GridShowcaseProps, Hero, type HeroAction, type HeroProps, InstallBanner, type InstallBannerProps, LANDING_GRADIENT_VAR, LANDING_PALETTE_DARK, LANDING_PALETTE_LIGHT, type LandingAction, LandingHero, type LandingHeroAction, type LandingHeroProps, type LandingLinkProps, type LandingLinkRender, type LandingNavigate, type LandingPalette, LandingSection, type LandingSectionProps, LogoMarquee, type LogoMarqueeItem, type LogoMarqueeProps, type SegmentMode, Spline, type SplineProps, Spotlight, SpotlightCard, type SpotlightCardProps, type SpotlightProps, TypewriterEffect, type TypewriterEffectProps, accentGradient as landingAccentGradient };
|