@react-fabric/superdate 1.0.0-beta.60 → 1.0.0-beta.62

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.
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var core = require('@react-fabric/core');
4
- var ar = require('./ar.json.js');
5
- var en = require('./en.json.js');
4
+ var superdate$1 = require('./ar/superdate.json.js');
5
+ var superdate = require('./en/superdate.json.js');
6
6
 
7
7
  /*
8
8
  * React Fabric
@@ -28,6 +28,6 @@ var en = require('./en.json.js');
28
28
  */
29
29
 
30
30
  core.addTranslationBundle("superdate", {
31
- en: en.default,
32
- ar: ar.default
31
+ en: superdate.default,
32
+ ar: superdate$1.default
33
33
  });
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
+ var yup = require('@hookform/resolvers/yup');
4
5
  var core = require('@react-fabric/core');
5
6
  var date = require('@react-fabric/date');
6
7
  var form = require('@react-fabric/form');
@@ -103,7 +104,7 @@ var QuickSelect = function QuickSelect(_ref) {
103
104
  zoom: 0.85
104
105
  },
105
106
  children: /*#__PURE__*/jsxRuntime.jsx(form.Form, {
106
- schema: schema,
107
+ resolver: yup.yupResolver(schema),
107
108
  onSubmit: handleChange,
108
109
  defaultValues: defaultValue,
109
110
  children: /*#__PURE__*/jsxRuntime.jsx(RelativeInput.RelativeInput, {
@@ -48,7 +48,6 @@ var RelativeInput = function RelativeInput(_ref) {
48
48
  }), /*#__PURE__*/jsxRuntime.jsx(form.Controller, {
49
49
  name: "".concat(prefix, ".part"),
50
50
  children: /*#__PURE__*/jsxRuntime.jsx(form.Select, {
51
- width: "6rem",
52
51
  options: Object.values(date.DatePart).slice(1).map(function (dt) {
53
52
  return {
54
53
  id: dt,
@@ -70,6 +69,8 @@ var RelativeInput = function RelativeInput(_ref) {
70
69
  })
71
70
  }), showApply && /*#__PURE__*/jsxRuntime.jsx(core.Button, {
72
71
  variant: "solid",
72
+ color: "primary",
73
+ size: "sm",
73
74
  type: "submit",
74
75
  "data-dropdown-dismiss": "true",
75
76
  children: t("label.apply")
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
+ var yup = require('@hookform/resolvers/yup');
4
5
  var core = require('@react-fabric/core');
5
6
  var date = require('@react-fabric/date');
6
7
  var form = require('@react-fabric/form');
@@ -66,7 +67,7 @@ var RelativePanel = function RelativePanel(_ref) {
66
67
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
67
68
  className: "scale-90",
68
69
  children: /*#__PURE__*/jsxRuntime.jsxs(form.Form, {
69
- schema: schema,
70
+ resolver: yup.yupResolver(schema),
70
71
  defaultValues: defaultValue,
71
72
  onSubmit: handleChange,
72
73
  children: [/*#__PURE__*/jsxRuntime.jsx(RelativeInput.RelativeInput, {
@@ -79,6 +80,8 @@ var RelativePanel = function RelativePanel(_ref) {
79
80
  className: "flex justify-end",
80
81
  children: /*#__PURE__*/jsxRuntime.jsx(core.Button, {
81
82
  variant: "solid",
83
+ color: "primary",
84
+ size: "sm",
82
85
  type: "submit",
83
86
  "data-dropdown-dismiss": "true",
84
87
  children: t("label.apply")
@@ -189,7 +189,7 @@ var SuperDate = function SuperDate(_ref4) {
189
189
  children: [/*#__PURE__*/jsxRuntime.jsx(core.Tooltip, {
190
190
  content: date.DateUtil.relativeTooltip(relValue, isHijri),
191
191
  children: /*#__PURE__*/jsxRuntime.jsx(E, {
192
- icon: core.CoreIcons.clock,
192
+ icon: "icon-[mdi--clock-outline]",
193
193
  size: size,
194
194
  color: color,
195
195
  disabled: disabled,
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { addTranslationBundle } from '@react-fabric/core';
4
- import ar from './ar.json.js';
5
- import en from './en.json.js';
4
+ import ar from './ar/superdate.json.js';
5
+ import en from './en/superdate.json.js';
6
6
 
7
7
  /*
8
8
  * React Fabric
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
+ import { yupResolver } from '@hookform/resolvers/yup';
4
5
  import { Content, Divider } from '@react-fabric/core';
5
6
  import { DatePart } from '@react-fabric/date';
6
7
  import { Form } from '@react-fabric/form';
@@ -103,7 +104,7 @@ var QuickSelect = function QuickSelect(_ref) {
103
104
  zoom: 0.85
104
105
  },
105
106
  children: /*#__PURE__*/jsx(Form, {
106
- schema: schema,
107
+ resolver: yupResolver(schema),
107
108
  onSubmit: handleChange,
108
109
  defaultValues: defaultValue,
109
110
  children: /*#__PURE__*/jsx(RelativeInput, {
@@ -48,7 +48,6 @@ var RelativeInput = function RelativeInput(_ref) {
48
48
  }), /*#__PURE__*/jsx(Controller, {
49
49
  name: "".concat(prefix, ".part"),
50
50
  children: /*#__PURE__*/jsx(Select, {
51
- width: "6rem",
52
51
  options: Object.values(DatePart).slice(1).map(function (dt) {
53
52
  return {
54
53
  id: dt,
@@ -70,6 +69,8 @@ var RelativeInput = function RelativeInput(_ref) {
70
69
  })
71
70
  }), showApply && /*#__PURE__*/jsx(Button, {
72
71
  variant: "solid",
72
+ color: "primary",
73
+ size: "sm",
73
74
  type: "submit",
74
75
  "data-dropdown-dismiss": "true",
75
76
  children: t("label.apply")
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
+ import { yupResolver } from '@hookform/resolvers/yup';
4
5
  import { Content, Button } from '@react-fabric/core';
5
6
  import { DatePart } from '@react-fabric/date';
6
7
  import { Form } from '@react-fabric/form';
@@ -66,7 +67,7 @@ var RelativePanel = function RelativePanel(_ref) {
66
67
  children: /*#__PURE__*/jsx("div", {
67
68
  className: "scale-90",
68
69
  children: /*#__PURE__*/jsxs(Form, {
69
- schema: schema,
70
+ resolver: yupResolver(schema),
70
71
  defaultValues: defaultValue,
71
72
  onSubmit: handleChange,
72
73
  children: [/*#__PURE__*/jsx(RelativeInput, {
@@ -79,6 +80,8 @@ var RelativePanel = function RelativePanel(_ref) {
79
80
  className: "flex justify-end",
80
81
  children: /*#__PURE__*/jsx(Button, {
81
82
  variant: "solid",
83
+ color: "primary",
84
+ size: "sm",
82
85
  type: "submit",
83
86
  "data-dropdown-dismiss": "true",
84
87
  children: t("label.apply")
@@ -4,7 +4,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
5
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
6
6
  import { useFloatingTree } from '@floating-ui/react';
7
- import { useGlobals, Dropdown, Tooltip, CoreIcons, TabPanel, Tab, Content, Button, Chip } from '@react-fabric/core';
7
+ import { useGlobals, Dropdown, Tooltip, TabPanel, Tab, Content, Button, Chip } from '@react-fabric/core';
8
8
  import { DateUtil, RangePanel, EventPanel } from '@react-fabric/date';
9
9
  import classNames from 'classnames';
10
10
  import { useMemo, useState, useEffect, useCallback } from 'react';
@@ -189,7 +189,7 @@ var SuperDate = function SuperDate(_ref4) {
189
189
  children: [/*#__PURE__*/jsx(Tooltip, {
190
190
  content: DateUtil.relativeTooltip(relValue, isHijri),
191
191
  children: /*#__PURE__*/jsx(E, {
192
- icon: CoreIcons.clock,
192
+ icon: "icon-[mdi--clock-outline]",
193
193
  size: size,
194
194
  color: color,
195
195
  disabled: disabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/superdate",
3
- "version": "1.0.0-beta.60",
3
+ "version": "1.0.0-beta.62",
4
4
  "description": "RUF: Superdate package for relative dates",
5
5
  "author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
6
6
  "license": "MIT",
@@ -36,10 +36,11 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@floating-ui/react": "~0.27.16",
39
- "@react-fabric/core": "^1.0.0-beta.60",
40
- "@react-fabric/date": "^1.0.0-beta.60",
41
- "@react-fabric/form": "^1.0.0-beta.60",
42
- "@react-fabric/utilities": "^1.0.0-beta.60",
39
+ "@hookform/resolvers": "~5.2.2",
40
+ "@react-fabric/core": "^1.0.0-beta.62",
41
+ "@react-fabric/date": "^1.0.0-beta.62",
42
+ "@react-fabric/form": "^1.0.0-beta.62",
43
+ "@react-fabric/utilities": "^1.0.0-beta.62",
43
44
  "classnames": "~2.5.1",
44
45
  "date-fns": "~4.1.0",
45
46
  "resize-observer-polyfill": "~1.5.1"
@@ -54,5 +55,5 @@
54
55
  "node": ">=18.12.0",
55
56
  "npm": ">=8.19.0"
56
57
  },
57
- "gitHead": "a79f053ee7e13422c06d7d9c35d4f0c2610cdf5d"
58
+ "gitHead": "9dce2fd9bb753d67e3f8adbf50be257b4bc64242"
58
59
  }
package/src/i18n/index.ts CHANGED
@@ -22,7 +22,7 @@
22
22
  */
23
23
 
24
24
  import { addTranslationBundle } from "@react-fabric/core";
25
- import ar from "./ar.json";
26
- import en from "./en.json";
25
+ import ar from "./ar/superdate.json";
26
+ import en from "./en/superdate.json";
27
27
 
28
28
  addTranslationBundle("superdate", { en, ar });
@@ -21,6 +21,7 @@
21
21
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
 
24
+ import { yupResolver } from "@hookform/resolvers/yup";
24
25
  import { Content, Divider } from "@react-fabric/core";
25
26
  import { DatePart } from "@react-fabric/date";
26
27
  import { Form } from "@react-fabric/form";
@@ -93,7 +94,7 @@ export const QuickSelect = ({
93
94
  style={{ zoom: 0.85 }}
94
95
  >
95
96
  <Form
96
- schema={schema}
97
+ resolver={yupResolver(schema)}
97
98
  onSubmit={handleChange}
98
99
  defaultValues={defaultValue}
99
100
  >
@@ -36,7 +36,6 @@ export const RelativeInput = ({ label, prefix, showApply }: KeyValue) => {
36
36
  </Controller>
37
37
  <Controller name={`${prefix}.part`}>
38
38
  <Select
39
- width="6rem"
40
39
  options={Object.values<string>(DatePart)
41
40
  .slice(1)
42
41
  .map((dt) => ({
@@ -55,7 +54,13 @@ export const RelativeInput = ({ label, prefix, showApply }: KeyValue) => {
55
54
  />
56
55
  </Controller>
57
56
  {showApply && (
58
- <Button variant="solid" type="submit" data-dropdown-dismiss="true">
57
+ <Button
58
+ variant="solid"
59
+ color="primary"
60
+ size="sm"
61
+ type="submit"
62
+ data-dropdown-dismiss="true"
63
+ >
59
64
  {t("label.apply")}
60
65
  </Button>
61
66
  )}
@@ -21,6 +21,7 @@
21
21
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
 
24
+ import { yupResolver } from "@hookform/resolvers/yup";
24
25
  import { Button, Content } from "@react-fabric/core";
25
26
  import { DatePart } from "@react-fabric/date";
26
27
  import { Form } from "@react-fabric/form";
@@ -85,14 +86,20 @@ export const RelativePanel = ({ value = "", onChange }: KeyValue) => {
85
86
  <Content>
86
87
  <div className="scale-90">
87
88
  <Form
88
- schema={schema}
89
+ resolver={yupResolver(schema)}
89
90
  defaultValues={defaultValue}
90
91
  onSubmit={handleChange}
91
92
  >
92
93
  <RelativeInput label={t("label.from")} prefix="from" />
93
94
  <RelativeInput label={t("label.to")} prefix="to" />
94
95
  <div className="flex justify-end">
95
- <Button variant="solid" type="submit" data-dropdown-dismiss="true">
96
+ <Button
97
+ variant="solid"
98
+ color="primary"
99
+ size="sm"
100
+ type="submit"
101
+ data-dropdown-dismiss="true"
102
+ >
96
103
  {t("label.apply")}
97
104
  </Button>
98
105
  </div>
@@ -26,7 +26,6 @@ import {
26
26
  Button,
27
27
  Chip,
28
28
  Content,
29
- CoreIcons,
30
29
  Dropdown,
31
30
  Tab,
32
31
  TabPanel,
@@ -213,7 +212,7 @@ export const SuperDate = ({
213
212
  <Dropdown showArrow>
214
213
  <Tooltip content={DateUtil.relativeTooltip(relValue, isHijri)}>
215
214
  <E
216
- icon={CoreIcons.clock}
215
+ icon="icon-[mdi--clock-outline]"
217
216
  size={size}
218
217
  color={color}
219
218
  disabled={disabled}
File without changes
File without changes