@modul/mbui 0.0.19-beta-pv-53151-14635d0d → 0.0.19-beta-pv-53151-acf19c73

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.
@@ -65,7 +65,7 @@ const buttonClasses = {
65
65
  focus-visible:text-btn-ghost-focus
66
66
  active:text-btn-ghost-active
67
67
  disabled:text-btn-ghost-disabled
68
- `
68
+ `,
69
69
  };
70
70
  const getPadings = (icon, variant) => {
71
71
  return (0, utils_1.cn)(icon && 'p-[12px] aspect-square', icon && variant === 'outline' && 'p-[13px] aspect-square', !icon && 'px-[24px] py-[12px]', !icon && variant === 'outline' && 'px-[25px] py-[13px]');
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ interface IProps {
3
+ children?: React.ReactNode;
4
+ className?: string;
5
+ }
6
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
7
+ asChild?: boolean;
8
+ }
9
+ declare const Icon: React.FC<IProps>;
10
+ declare const Content: React.FC<IProps>;
11
+ interface IButtonWidgetProps {
12
+ displayName: string;
13
+ Icon: typeof Icon;
14
+ Content: typeof Content;
15
+ }
16
+ declare const ButtonWidget: React.FC<ButtonProps> & IButtonWidgetProps;
17
+ export { ButtonWidget };
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ButtonWidget = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = (0, tslib_1.__importStar)(require("react"));
6
+ const react_slot_1 = require("@radix-ui/react-slot");
7
+ const utils_1 = require("../@/lib/utils");
8
+ const buttonClasses = `
9
+ inline-flex
10
+ items-center
11
+ shrink-0
12
+ p-[8px]
13
+ rounded-md
14
+ font-medium
15
+ leading-[1]
16
+ focus-visible:ring
17
+ focus-visible:outline-none
18
+ ring-offset-1
19
+ transition-colors
20
+ whitespace-nowrap
21
+ bg-page
22
+ shadow-md
23
+ active:shadow-sm
24
+ disabled:pointer-events-none
25
+ `;
26
+ const Icon = ({ children }) => {
27
+ return React.createElement("span", { className: "flex justify-center items-center bg-primary-light [&+span]:ml-[16px] rounded-full text-primary size-[40px]" }, children);
28
+ };
29
+ const Content = ({ children, className }) => {
30
+ return React.createElement("span", { className: (0, utils_1.cn)('text-dark', className) }, children);
31
+ };
32
+ const ButtonWidget = ({ className, asChild = false, ...props }) => {
33
+ const Comp = asChild ? react_slot_1.Slot : 'button';
34
+ return (React.createElement(Comp, { className: (0, utils_1.cn)(buttonClasses, className), ...props }));
35
+ };
36
+ exports.ButtonWidget = ButtonWidget;
37
+ ButtonWidget.displayName = 'ButtonWidget';
38
+ ButtonWidget.Icon = Icon;
39
+ ButtonWidget.Icon.displayName = 'ButtonWidget.Icon';
40
+ ButtonWidget.Content = Content;
41
+ ButtonWidget.Content.displayName = 'ButtonWidget.Content';
42
+ //# sourceMappingURL=ButtonWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonWidget.js","sourceRoot":"","sources":["../../src/Button/ButtonWidget.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,qDAA2C;AAE3C,0CAAmC;AAEnC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;CAiBrB,CAAA;AAWD,MAAM,IAAI,GAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/C,OAAO,8BAAM,SAAS,EAAC,4GAA4G,IAAE,QAAQ,CAAQ,CAAA;AACtJ,CAAC,CAAA;AAED,MAAM,OAAO,GAAqB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IAC7D,OAAO,8BAAM,SAAS,EAAE,IAAA,UAAE,EAAC,WAAW,EAAE,SAAS,CAAC,IAAG,QAAQ,CAAQ,CAAA;AACtE,CAAC,CAAA;AAQD,MAAM,YAAY,GAA+C,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC5G,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,QAAQ,CAAA;IACtC,OAAO,CACN,oBAAC,IAAI,IACJ,SAAS,EAAE,IAAA,UAAE,EAAC,aAAa,EAAE,SAAS,CAAC,KACnC,KAAK,GACR,CACF,CAAA;AACF,CAAC,CAAA;AAWO,oCAAY;AARrB,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA;AAEzC,YAAY,CAAC,IAAI,GAAG,IAAI,CAAA;AACxB,YAAY,CAAC,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEnD,YAAY,CAAC,OAAO,GAAG,OAAO,CAAA;AAC9B,YAAY,CAAC,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA"}
@@ -1 +1,2 @@
1
1
  export { Button, buttonVariants } from './Button';
2
+ export { ButtonWidget } from './ButtonWidget';
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buttonVariants = exports.Button = void 0;
3
+ exports.ButtonWidget = exports.buttonVariants = exports.Button = void 0;
4
4
  var Button_1 = require("./Button");
5
5
  Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
6
6
  Object.defineProperty(exports, "buttonVariants", { enumerable: true, get: function () { return Button_1.buttonVariants; } });
7
+ var ButtonWidget_1 = require("./ButtonWidget");
8
+ Object.defineProperty(exports, "ButtonWidget", { enumerable: true, get: function () { return ButtonWidget_1.ButtonWidget; } });
7
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Button/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AAAxC,gGAAA,MAAM,OAAA;AAAE,wGAAA,cAAc,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Button/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AAAxC,gGAAA,MAAM,OAAA;AAAE,wGAAA,cAAc,OAAA;AAC/B,+CAA6C;AAApC,4GAAA,YAAY,OAAA"}
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  interface IProps {
3
+ dateFormat?: any;
3
4
  mode?: any;
4
5
  placeholder?: string;
5
6
  date?: Date;
@@ -10,11 +10,11 @@ const Icon_1 = require("../../src/Icon");
10
10
  const Popover_1 = require("../../src/Popover");
11
11
  const locale_1 = require("date-fns/locale");
12
12
  const trigegrClasses = 'inline-flex items-center px-[12px] h-[44px] text-left border-input border rounded-sm';
13
- const DatePicker = ({ placeholder, triggerDisabled, date, classTrigger, ...props }) => {
13
+ const DatePicker = ({ placeholder, triggerDisabled, date, classTrigger, dateFormat = 'PPP', ...props }) => {
14
14
  return (React.createElement(Popover_1.Popover, null,
15
15
  React.createElement(Popover_1.Popover.Trigger, { asChild: true },
16
16
  React.createElement("button", { className: (0, utils_1.cn)(trigegrClasses, { 'bg-light text-light': triggerDisabled }, classTrigger), disabled: triggerDisabled },
17
- date ? React.createElement("span", { className: 'w-[calc(100%-26px)] truncate' }, (0, date_fns_1.format)(date, 'PPP', { locale: locale_1.ru })) : React.createElement("span", { className: 'w-[calc(100%-26px)] text-light truncate' }, placeholder),
17
+ date ? React.createElement("span", { className: 'w-[calc(100%-26px)] truncate' }, (0, date_fns_1.format)(date, dateFormat, { locale: locale_1.ru })) : React.createElement("span", { className: 'w-[calc(100%-26px)] text-light truncate' }, placeholder),
18
18
  React.createElement(Icon_1.Calendar, { width: 18, height: 18, className: "ml-[8px] text-light shrink-0" }))),
19
19
  React.createElement(Popover_1.Popover.Content, { className: "bg-page p-0 w-auto", align: "center" },
20
20
  React.createElement(Calendar_1.Calendar, { ...props }))));
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../src/DatePicker/DatePicker.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,uCAAiC;AACjC,0CAAmC;AACnC,iDAA6C;AAC7C,yCAAyD;AACzD,+CAA2C;AAC3C,4CA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C,EAAE,EAAE;IAE3H,OAAO,CACN,oBAAC,iBAAO;QACP,oBAAC,iBAAO,CAAC,OAAO,IAAC,OAAO;YACvB,gCAAQ,SAAS,EAAE,IAAA,UAAE,EAAC,cAAc,EAAE,EAAC,qBAAqB,EAAC,eAAe,EAAC,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE,eAAe;gBACrH,IAAI,CAAC,CAAC,CAAC,8BAAM,SAAS,EAAC,8BAA8B,IAAE,IAAA,iBAAM,EAAC,IAAI,EAAE,UAAU,EAAE,EAAC,MAAM,EAAE,WAAE,EAAC,CAAC,CAAQ,CAAC,CAAC,CAAC,8BAAM,SAAS,EAAC,yCAAyC,IAAE,WAAW,CAAQ;gBACvL,oBAAC,eAAY,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAC,8BAA8B,GAAG,CACxE,CACQ;QAClB,oBAAC,iBAAO,CAAC,OAAO,IACf,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAC,QAAQ;YAEd,oBAAC,mBAAQ,OAAK,KAAK,GAAG,CACL,CACT,CACV,CAAA;AACF,CAAC,CAAA;AAEQ,gCAAU"}
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import { BottomNavigation, BottomNavigationList, BottomNavigationListItem, Botto
8
8
  import * as Icon from './Icon';
9
9
  import { Collapsible, CollapsibleTrigger, CollapsibleContent } from './Collapsible';
10
10
  import { AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem } from './Collapsible';
11
- import { Button } from './Button';
11
+ import { Button, ButtonWidget } from './Button';
12
12
  import { Audio } from './Audio';
13
13
  import { cn } from './@/lib/utils';
14
14
  import { Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent } from './Drawer';
@@ -29,4 +29,4 @@ import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader,
29
29
  import { MessageTyping } from "./Chat";
30
30
  import { FavoritePaymentsList, FavoritePaymentsItem, FarvoritePaymentDescription, farvoriteLinkClasses } from './FavoritePyments';
31
31
  import { DigitKeyPad } from "./DigitKeyPad";
32
- export { Tooltip, Tabs, Slider, Popover, Logo, InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, Collapsible, CollapsibleTrigger, CollapsibleContent, AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem, Button, InputField, InputLabel, Audio, cn, Icon, Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent, BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink, Page, Chip, Progress, Alert, Switch, Label, Textarea, SelectAccountCard, Form, FormLabel, FormField, FormItem, FormControl, FormDescription, FormMessage, Calendar, DatePicker, SelectAsync, InputMask, Select, AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, MessageTyping, FavoritePaymentsList, FavoritePaymentsItem, FarvoritePaymentDescription, farvoriteLinkClasses, DigitKeyPad, };
32
+ export { Tooltip, Tabs, Slider, Popover, Logo, InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, Collapsible, CollapsibleTrigger, CollapsibleContent, AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem, Button, InputField, InputLabel, Audio, cn, Icon, Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent, BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink, Page, Chip, Progress, Alert, Switch, Label, Textarea, SelectAccountCard, Form, FormLabel, FormField, FormItem, FormControl, FormDescription, FormMessage, Calendar, DatePicker, SelectAsync, InputMask, Select, AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, MessageTyping, FavoritePaymentsList, FavoritePaymentsItem, FarvoritePaymentDescription, farvoriteLinkClasses, DigitKeyPad, ButtonWidget, };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SelectAsync = exports.DatePicker = exports.Calendar = exports.FormMessage = exports.FormDescription = exports.FormControl = exports.FormItem = exports.FormField = exports.FormLabel = exports.Form = exports.SelectAccountCard = exports.Textarea = exports.Label = exports.Switch = exports.Alert = exports.Progress = exports.Chip = exports.Page = exports.BottomNavigationLink = exports.BottomNavigationListItem = exports.BottomNavigationList = exports.BottomNavigation = exports.DrawerContent = exports.DrawerClose = exports.DrawerTitle = exports.DrawerTrigger = exports.Drawer = exports.Icon = exports.cn = exports.Audio = exports.InputLabel = exports.InputField = exports.Button = exports.AccountCollapsibleContentItem = exports.AccountCollapsibleContent = exports.AccountCollapsibleTrigger = exports.AccountCollapsibleHeader = exports.AccountCollapsible = exports.CollapsibleContent = exports.CollapsibleTrigger = exports.Collapsible = exports.InputOTPSeparator = exports.InputOTPSlot = exports.InputOTPGroup = exports.InputOTP = exports.Logo = exports.Popover = exports.Slider = exports.Tabs = exports.Tooltip = void 0;
4
- exports.DigitKeyPad = exports.farvoriteLinkClasses = exports.FarvoritePaymentDescription = exports.FavoritePaymentsItem = exports.FavoritePaymentsList = exports.MessageTyping = exports.AlertDialogCancel = exports.AlertDialogAction = exports.AlertDialogDescription = exports.AlertDialogTitle = exports.AlertDialogFooter = exports.AlertDialogHeader = exports.AlertDialogContent = exports.AlertDialogTrigger = exports.AlertDialog = exports.Select = exports.InputMask = void 0;
4
+ exports.ButtonWidget = exports.DigitKeyPad = exports.farvoriteLinkClasses = exports.FarvoritePaymentDescription = exports.FavoritePaymentsItem = exports.FavoritePaymentsList = exports.MessageTyping = exports.AlertDialogCancel = exports.AlertDialogAction = exports.AlertDialogDescription = exports.AlertDialogTitle = exports.AlertDialogFooter = exports.AlertDialogHeader = exports.AlertDialogContent = exports.AlertDialogTrigger = exports.AlertDialog = exports.Select = exports.InputMask = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const Tooltip_1 = require("./Tooltip");
7
7
  Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
@@ -37,6 +37,7 @@ Object.defineProperty(exports, "AccountCollapsibleContent", { enumerable: true,
37
37
  Object.defineProperty(exports, "AccountCollapsibleContentItem", { enumerable: true, get: function () { return Collapsible_2.AccountCollapsibleContentItem; } });
38
38
  const Button_1 = require("./Button");
39
39
  Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
40
+ Object.defineProperty(exports, "ButtonWidget", { enumerable: true, get: function () { return Button_1.ButtonWidget; } });
40
41
  const Audio_1 = require("./Audio");
41
42
  Object.defineProperty(exports, "Audio", { enumerable: true, get: function () { return Audio_1.Audio; } });
42
43
  const utils_1 = require("./@/lib/utils");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,uCAAmC;AAuDlC,wFAvDQ,iBAAO,OAuDR;AAtDR,iCAA6B;AAuD5B,qFAvDQ,WAAI,OAuDR;AAtDL,qCAAiC;AAuDhC,uFAvDQ,eAAM,OAuDR;AAtDP,uCAAmC;AAuDlC,wFAvDQ,iBAAO,OAuDR;AAtDR,+DAAyB;AAuDxB,eAvDM,cAAI,CAuDN;AAtDL,2CAAsF;AAuDrF,yFAvDQ,oBAAQ,OAuDR;AACR,8FAxDkB,yBAAa,OAwDlB;AACb,6FAzDiC,wBAAY,OAyDjC;AACZ,kGA1D+C,6BAAiB,OA0D/C;AAzDlB,yDAK2B;AAwE1B,iGA5EA,mCAAgB,OA4EA;AAChB,qGA5EA,uCAAoB,OA4EA;AACpB,yGA5EA,2CAAwB,OA4EA;AACxB,qGA5EA,uCAAoB,OA4EA;AA1ErB,0DAA8B;AAiE7B,oBAAI;A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vG,qFA9DQ,WAAI,OA8DR;AACJ,0FA/Dc,gBAAS,OA+Dd;AACT,0FAhEyB,gBAAS,OAgEzB;AACT,yFAjEoC,eAAQ,OAiEpC;AACR,4FAlE8C,kBAAW,OAkE9C;AACX,gGAnE2D,sBAAe,OAmE3D;AACf,4FApE4E,kBAAW,OAoE5E;AAnEZ,yCAAqC;AAoEpC,yFApEQ,mBAAQ,OAoER;AAnET,6CAAyC;AAoExC,2FApEQ,uBAAU,OAoER;AAnEX,qCAAiC;AAsEhC,uFAtEQ,eAAM,OAsER;AArEP,yCAAqC;AAoDpC,yFApDQ,mBAAQ,OAoDR;AAnDT,+CAUsB;AA2DrB,4FApEA,yBAAW,OAoEA;AACX,mGApEA,gCAAkB,OAoEA;AAClB,mGApEA,gCAAkB,OAoEA;AAClB,kGApEA,+BAAiB,OAoEA;AACjB,kGApEA,+BAAiB,OAoEA;AACjB,iGApEA,8BAAgB,OAoEA;AAChB,uGApEA,oCAAsB,OAoEA;AACtB,kGApEA,+BAAiB,OAoEA;AACjB,kGApEA,+BAAiB,OAoEA;AAlElB,iCAAsC;AAmErC,8FAnEQ,oBAAa,OAmER;AAlEd,uDAAiI;AAmEhI,qGAnEQ,sCAAoB,OAmER;AACpB,qGApE8B,sCAAoB,OAoE9B;AACpB,4GArEoD,6CAA2B,OAqEpD;AAC3B,qGAtEiF,sCAAoB,OAsEjF;AArErB,+CAA2C;AAsE1C,4FAtEQ,yBAAW,OAsER"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modul/mbui",
3
- "version": "0.0.19-beta-pv-53151-14635d0d",
3
+ "version": "0.0.19-beta-pv-53151-acf19c73",
4
4
  "packageManager": "yarn@3.5.1",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -62,7 +62,7 @@ const buttonClasses = {
62
62
  focus-visible:text-btn-ghost-focus
63
63
  active:text-btn-ghost-active
64
64
  disabled:text-btn-ghost-disabled
65
- `
65
+ `,
66
66
  }
67
67
 
68
68
  const getPadings = (icon, variant) => {
@@ -70,7 +70,7 @@ const getPadings = (icon, variant) => {
70
70
  icon && 'p-[12px] aspect-square',
71
71
  icon && variant === 'outline' && 'p-[13px] aspect-square',
72
72
  !icon && 'px-[24px] py-[12px]',
73
- !icon && variant === 'outline' && 'px-[25px] py-[13px]'
73
+ !icon && variant === 'outline' && 'px-[25px] py-[13px]',
74
74
  )
75
75
  }
76
76
  interface IVariantProps {
@@ -0,0 +1,67 @@
1
+ import * as React from 'react'
2
+ import { Slot } from '@radix-ui/react-slot'
3
+ import { cva, type VariantProps } from 'class-variance-authority'
4
+ import { cn } from '../@/lib/utils'
5
+
6
+ const buttonClasses = `
7
+ inline-flex
8
+ items-center
9
+ shrink-0
10
+ p-[8px]
11
+ rounded-md
12
+ font-medium
13
+ leading-[1]
14
+ focus-visible:ring
15
+ focus-visible:outline-none
16
+ ring-offset-1
17
+ transition-colors
18
+ whitespace-nowrap
19
+ bg-page
20
+ shadow-md
21
+ active:shadow-sm
22
+ disabled:pointer-events-none
23
+ `
24
+
25
+ interface IProps {
26
+ children?: React.ReactNode
27
+ className?: string
28
+ }
29
+
30
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
31
+ asChild?: boolean
32
+ }
33
+
34
+ const Icon: React.FC<IProps> = ({ children }) => {
35
+ return <span className="flex justify-center items-center bg-primary-light [&+span]:ml-[16px] rounded-full text-primary size-[40px]">{children}</span>
36
+ }
37
+
38
+ const Content: React.FC<IProps> = ({ children, className }) => {
39
+ return <span className={cn('text-dark', className)}>{children}</span>
40
+ }
41
+
42
+ interface IButtonWidgetProps {
43
+ displayName: string
44
+ Icon: typeof Icon
45
+ Content: typeof Content
46
+ }
47
+
48
+ const ButtonWidget: React.FC<ButtonProps> & IButtonWidgetProps = ({ className, asChild = false, ...props }) => {
49
+ const Comp = asChild ? Slot : 'button'
50
+ return (
51
+ <Comp
52
+ className={cn(buttonClasses, className)}
53
+ {...props}
54
+ />
55
+ )
56
+ }
57
+
58
+
59
+ ButtonWidget.displayName = 'ButtonWidget'
60
+
61
+ ButtonWidget.Icon = Icon
62
+ ButtonWidget.Icon.displayName = 'ButtonWidget.Icon'
63
+
64
+ ButtonWidget.Content = Content
65
+ ButtonWidget.Content.displayName = 'ButtonWidget.Content'
66
+
67
+ export { ButtonWidget }
@@ -1 +1,2 @@
1
- export { Button, buttonVariants } from './Button'
1
+ export { Button, buttonVariants } from './Button'
2
+ export { ButtonWidget } from './ButtonWidget'
@@ -9,6 +9,7 @@ import { ru } from 'date-fns/locale'
9
9
  const trigegrClasses = 'inline-flex items-center px-[12px] h-[44px] text-left border-input border rounded-sm'
10
10
 
11
11
  interface IProps {
12
+ dateFormat?: any,
12
13
  mode?: any;
13
14
  placeholder?: string,
14
15
  date?: Date,
@@ -17,13 +18,13 @@ interface IProps {
17
18
  onSelect?: (value: Date) => void
18
19
  }
19
20
 
20
- const DatePicker: React.FC<IProps> = ({placeholder, triggerDisabled, date, classTrigger, ...props}) => {
21
+ const DatePicker: React.FC<IProps> = ({placeholder, triggerDisabled, date, classTrigger, dateFormat = 'PPP', ...props}) => {
21
22
 
22
23
  return (
23
24
  <Popover>
24
25
  <Popover.Trigger asChild>
25
26
  <button className={cn(trigegrClasses, {'bg-light text-light':triggerDisabled}, classTrigger)} disabled={triggerDisabled}>
26
- {date ? <span className='w-[calc(100%-26px)] truncate'>{format(date ,'PPP', {locale: ru})}</span> : <span className='w-[calc(100%-26px)] text-light truncate'>{placeholder}</span>}
27
+ {date ? <span className='w-[calc(100%-26px)] truncate'>{format(date ,dateFormat, {locale: ru})}</span> : <span className='w-[calc(100%-26px)] text-light truncate'>{placeholder}</span>}
27
28
  <CalendarIcon width={18} height={18} className="ml-[8px] text-light shrink-0" />
28
29
  </button>
29
30
  </Popover.Trigger>
package/src/index.ts CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  AccountCollapsibleContent,
20
20
  AccountCollapsibleContentItem,
21
21
  } from './Collapsible'
22
- import { Button } from './Button'
22
+ import { Button, ButtonWidget } from './Button'
23
23
  import { Audio } from './Audio'
24
24
  import { cn } from './@/lib/utils'
25
25
  import { Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent } from './Drawer'
@@ -120,4 +120,5 @@ export {
120
120
  FarvoritePaymentDescription,
121
121
  farvoriteLinkClasses,
122
122
  DigitKeyPad,
123
+ ButtonWidget,
123
124
  }