@vkontakte/vkui 8.2.0 → 8.2.2
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/dist/components/Banner/Banner.d.ts.map +1 -1
- package/dist/components/Banner/Banner.js +7 -1
- package/dist/components/Banner/Banner.js.map +1 -1
- package/dist/components/DateInput/DateInput.js +1 -1
- package/dist/components/DateInput/DateInput.js.map +1 -1
- package/dist/components/DateRangeInput/DateRangeInput.js +1 -1
- package/dist/components/DateRangeInput/DateRangeInput.js.map +1 -1
- package/dist/components/Search/Search.js +1 -4
- package/dist/components/Search/Search.js.map +1 -1
- package/dist/components/Snackbar/subcomponents/Basic/Basic.d.ts +1 -1
- package/dist/components/Snackbar/subcomponents/Basic/Basic.d.ts.map +1 -1
- package/dist/components/Snackbar/subcomponents/Basic/Basic.js +11 -2
- package/dist/components/Snackbar/subcomponents/Basic/Basic.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheet.module.css +5 -3
- package/dist/cssm/components/Banner/Banner.js +7 -1
- package/dist/cssm/components/Banner/Banner.js.map +1 -1
- package/dist/cssm/components/DateInput/DateInput.js +1 -1
- package/dist/cssm/components/DateInput/DateInput.js.map +1 -1
- package/dist/cssm/components/DateRangeInput/DateRangeInput.js +1 -1
- package/dist/cssm/components/DateRangeInput/DateRangeInput.js.map +1 -1
- package/dist/cssm/components/PullToRefresh/PullToRefresh.module.css +2 -0
- package/dist/cssm/components/Search/Search.js +1 -4
- package/dist/cssm/components/Search/Search.js.map +1 -1
- package/dist/cssm/components/Search/Search.module.css +8 -11
- package/dist/cssm/components/Snackbar/subcomponents/Basic/Basic.js +11 -2
- package/dist/cssm/components/Snackbar/subcomponents/Basic/Basic.js.map +1 -1
- package/dist/cssm/components/Snackbar/subcomponents/Basic/Basic.module.css +0 -8
- package/dist/cssm/hooks/useMergeProps.js +1 -1
- package/dist/cssm/hooks/useMergeProps.js.map +1 -1
- package/dist/cssm/lib/date.js +1 -1
- package/dist/cssm/lib/date.js.map +1 -1
- package/dist/cssm/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js +1 -1
- package/dist/cssm/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js.map +1 -1
- package/dist/hooks/useMergeProps.js +1 -1
- package/dist/hooks/useMergeProps.js.map +1 -1
- package/dist/lib/date.js +1 -1
- package/dist/lib/date.js.map +1 -1
- package/dist/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js +1 -1
- package/dist/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.js.map +1 -1
- package/dist/vkui.css +1 -1
- package/dist/vkui.css.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionSheet/ActionSheet.module.css +5 -3
- package/src/components/ActionSheet/ActionSheet.module.css.d.ts.map +1 -1
- package/src/components/Banner/Banner.tsx +8 -5
- package/src/components/DateInput/DateInput.tsx +1 -1
- package/src/components/DateRangeInput/DateRangeInput.tsx +1 -1
- package/src/components/PullToRefresh/PullToRefresh.module.css +2 -0
- package/src/components/PullToRefresh/PullToRefresh.module.css.d.ts.map +1 -1
- package/src/components/Search/Search.module.css +8 -11
- package/src/components/Search/Search.module.css.d.ts.map +1 -1
- package/src/components/Search/Search.tsx +1 -1
- package/src/components/Snackbar/subcomponents/Basic/Basic.module.css +0 -8
- package/src/components/Snackbar/subcomponents/Basic/Basic.module.css.d.ts.map +1 -1
- package/src/components/Snackbar/subcomponents/Basic/Basic.tsx +9 -3
- package/src/hooks/useMergeProps.ts +1 -1
- package/src/lib/date.ts +1 -1
- package/src/lib/floating/useFloatingWithInteractions/useFloatingWithInteractions.ts +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
3
4
|
import { classNames } from "@vkontakte/vkjs";
|
|
4
5
|
import { useAdaptivity } from "../../../../hooks/useAdaptivity.js";
|
|
6
|
+
import { ColorSchemeProvider } from "../../../ColorSchemeProvider/ColorSchemeProvider.js";
|
|
5
7
|
import { RootComponent } from "../../../RootComponent/RootComponent.js";
|
|
6
8
|
import { Paragraph } from "../../../Typography/Paragraph/Paragraph.js";
|
|
7
9
|
import { Subhead } from "../../../Typography/Subhead/Subhead.js";
|
|
@@ -17,9 +19,9 @@ const densityClassNames = {
|
|
|
17
19
|
export function Basic({ layout: layoutProps, action, after, before, mode, subtitle, children, ...restProps }) {
|
|
18
20
|
const { density = 'none' } = useAdaptivity();
|
|
19
21
|
const layout = after || subtitle ? 'vertical' : 'none';
|
|
20
|
-
|
|
22
|
+
const snackbar = /*#__PURE__*/ _jsxs(RootComponent, {
|
|
21
23
|
...restProps,
|
|
22
|
-
baseClassName: classNames("vkuiBasic__body", stylesLayout[layoutProps || layout], density !== 'compact' && densityClassNames[density]
|
|
24
|
+
baseClassName: classNames("vkuiBasic__body", stylesLayout[layoutProps || layout], density !== 'compact' && densityClassNames[density]),
|
|
23
25
|
children: [
|
|
24
26
|
before && /*#__PURE__*/ _jsx("div", {
|
|
25
27
|
className: "vkuiBasic__before",
|
|
@@ -48,6 +50,13 @@ export function Basic({ layout: layoutProps, action, after, before, mode, subtit
|
|
|
48
50
|
})
|
|
49
51
|
]
|
|
50
52
|
});
|
|
53
|
+
if (mode === 'dark') {
|
|
54
|
+
return /*#__PURE__*/ _jsx(ColorSchemeProvider, {
|
|
55
|
+
value: "dark",
|
|
56
|
+
children: snackbar
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return snackbar;
|
|
51
60
|
}
|
|
52
61
|
|
|
53
62
|
//# sourceMappingURL=Basic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Snackbar/subcomponents/Basic/Basic.tsx"],"sourcesContent":["'use client';\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Snackbar/subcomponents/Basic/Basic.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { classNames } from '@vkontakte/vkjs';\nimport { useAdaptivity } from '../../../../hooks/useAdaptivity';\nimport type { HTMLAttributesWithRootRef } from '../../../../types';\nimport { ColorSchemeProvider } from '../../../ColorSchemeProvider/ColorSchemeProvider';\nimport { RootComponent } from '../../../RootComponent/RootComponent';\nimport { Paragraph } from '../../../Typography/Paragraph/Paragraph';\nimport { Subhead } from '../../../Typography/Subhead/Subhead';\nimport styles from './Basic.module.css';\n\nconst stylesLayout = {\n none: styles.layoutNone,\n vertical: styles.layoutVertical,\n horizontal: styles.layoutHorizontal,\n};\n\nconst densityClassNames = {\n none: styles.densityNone,\n regular: styles.densityRegular,\n};\n\nexport interface BasicProps {\n /**\n * Элемент действия.\n * Не может использоваться одновременно с `subtitle`.\n */\n action?: React.ReactNode | undefined;\n\n /**\n * Контент в правой части, может быть иконкой 24x24.\n */\n after?: React.ReactNode | undefined;\n\n /**\n * Варианты расположения кнопки действия\n * По умолчанию на десктопах, или при наличии элементов `after` или `subtitle`\n * имеет значение `vertical`, в остальных случаях `horizontal`.\n */\n layout?: 'vertical' | 'horizontal' | undefined;\n\n /**\n * Может быть следующими компонентами:\n * - цветная иконка 24x24 или 28x28 пикселя\n * - `<Avatar size={32} />`\n * - `<Image size={40} />`.\n */\n before?: React.ReactNode | undefined;\n\n /**\n * Задает стиль снекбара.\n */\n mode?: 'default' | 'dark' | undefined;\n\n /**\n * Дополнительная строка текста под `children`.\n * Не может использоваться одновременно с `action`.\n */\n subtitle?: React.ReactNode | undefined;\n}\n\nexport interface SnackbarBasicProps extends HTMLAttributesWithRootRef<HTMLDivElement>, BasicProps {}\n\nexport function Basic({\n layout: layoutProps,\n action,\n after,\n before,\n mode,\n subtitle,\n children,\n ...restProps\n}: SnackbarBasicProps): React.ReactNode {\n const { density = 'none' } = useAdaptivity();\n const layout = after || subtitle ? 'vertical' : 'none';\n\n const snackbar = (\n <RootComponent\n {...restProps}\n baseClassName={classNames(\n styles.body,\n stylesLayout[layoutProps || layout],\n density !== 'compact' && densityClassNames[density],\n )}\n >\n {before && <div className={styles.before}>{before}</div>}\n\n <div className={styles.content}>\n <Paragraph className={styles.contentText}>{children}</Paragraph>\n {subtitle && !action && <Subhead className={styles.contentSubtitle}>{subtitle}</Subhead>}\n\n {action && !subtitle && <div className={styles.action}>{action}</div>}\n </div>\n\n {after && <div className={styles.after}>{after}</div>}\n </RootComponent>\n );\n\n if (mode === 'dark') {\n return <ColorSchemeProvider value=\"dark\">{snackbar}</ColorSchemeProvider>;\n }\n\n return snackbar;\n}\n"],"names":["React","classNames","useAdaptivity","ColorSchemeProvider","RootComponent","Paragraph","Subhead","stylesLayout","none","vertical","horizontal","densityClassNames","regular","Basic","layout","layoutProps","action","after","before","mode","subtitle","children","restProps","density","snackbar","baseClassName","div","className","value"],"mappings":"AAAA;;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,aAAa,QAAQ,qCAAkC;AAEhE,SAASC,mBAAmB,QAAQ,sDAAmD;AACvF,SAASC,aAAa,QAAQ,0CAAuC;AACrE,SAASC,SAAS,QAAQ,6CAA0C;AACpE,SAASC,OAAO,QAAQ,yCAAsC;AAG9D,MAAMC,eAAe;IACnBC,IAAI;IACJC,QAAQ;IACRC,UAAU;AACZ;AAEA,MAAMC,oBAAoB;IACxBH,IAAI;IACJI,OAAO;AACT;AA2CA,OAAO,SAASC,MAAM,EACpBC,QAAQC,WAAW,EACnBC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACR,GAAGC,WACgB;IACnB,MAAM,EAAEC,UAAU,MAAM,EAAE,GAAGrB;IAC7B,MAAMY,SAASG,SAASG,WAAW,aAAa;IAEhD,MAAMI,yBACJ,MAACpB;QACE,GAAGkB,SAAS;QACbG,eAAexB,8BAEbM,YAAY,CAACQ,eAAeD,OAAO,EACnCS,YAAY,aAAaZ,iBAAiB,CAACY,QAAQ;;YAGpDL,wBAAU,KAACQ;gBAAIC,SAAS;0BAAkBT;;0BAE3C,MAACQ;gBAAIC,SAAS;;kCACZ,KAACtB;wBAAUsB,SAAS;kCAAuBN;;oBAC1CD,YAAY,CAACJ,wBAAU,KAACV;wBAAQqB,SAAS;kCAA2BP;;oBAEpEJ,UAAU,CAACI,0BAAY,KAACM;wBAAIC,SAAS;kCAAkBX;;;;YAGzDC,uBAAS,KAACS;gBAAIC,SAAS;0BAAiBV;;;;IAI7C,IAAIE,SAAS,QAAQ;QACnB,qBAAO,KAAChB;YAAoByB,OAAM;sBAAQJ;;IAC5C;IAEA,OAAOA;AACT"}
|