@react-fabric/date 1.0.0-beta.36 → 1.0.0-beta.37

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.
@@ -21,12 +21,12 @@
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
- @layer comp {
25
- .dateHeader {
26
- box-shadow: 0 -1px 0 theme(colors.tint.200/50%) inset;
24
+ @layer components {
25
+ .fabric-dateHeader {
26
+ box-shadow: 0 -1px 0 --alpha(var(--color-tint-200) / 50%) inset;
27
27
  }
28
28
 
29
- .timeSlider {
29
+ .fabric-date-timeSlider {
30
30
  height: 11.25rem;
31
31
 
32
32
  &::before,
@@ -34,7 +34,7 @@
34
34
  content: "";
35
35
  z-index: 10;
36
36
  display: block;
37
- box-shadow: 0 0 3rem 0.25rem theme(colors.tint.600);
37
+ box-shadow: 0 0 3rem 0.25rem var(--color-tint-600);
38
38
  }
39
39
 
40
40
  &::before {
package/css/styles.css ADDED
@@ -0,0 +1,24 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2025 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ @import "./_date.css";
@@ -9,7 +9,6 @@ var dateUtil = require('../utils/dateUtil.js');
9
9
  var DateCell = require('./DateCell.js');
10
10
  var classNames = require('classnames');
11
11
  var index = require('../types/index.js');
12
- var Date_module = require('./Date.module.css');
13
12
  var jsxRuntime = require('react/jsx-runtime');
14
13
 
15
14
  var _excluded = ["pageDate", "isHijri"];
@@ -29,11 +28,11 @@ var DatePage = function DatePage(_ref) {
29
28
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
30
29
  className: classNames("grid grid-cols-8 area-content", props.page !== index.PageType.DATE && "invisible"),
31
30
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
32
- className: classNames(Date_module.dateHeader, "px-1 text-center bg-tint-50 h-7")
31
+ className: classNames("fabric-dateHeader", "px-1 text-center bg-tint-50 h-7")
33
32
  }), cols.map(function (col) {
34
33
  var dt = dateUtil.DateUtil.addDays(startDate, col, isHijri);
35
34
  return /*#__PURE__*/jsxRuntime.jsx("div", {
36
- className: classNames(Date_module.dateHeader, "font-medium text-sm p-1 mx-px text-center text-muted bg-tint-50 h-7"),
35
+ className: classNames("fabric-dateHeader", "font-medium text-sm p-1 mx-px text-center text-muted bg-tint-50 h-7"),
37
36
  children: dateUtil.DateUtil.format(dt, "eeeeee", i18next.language, isHijri)
38
37
  }, dt.toISOString());
39
38
  }), rows.map(function (row) {
@@ -4,7 +4,6 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
4
  var core = require('@react-fabric/core');
5
5
  var classNames = require('classnames');
6
6
  var react = require('react');
7
- var Date_module = require('./Date.module.css');
8
7
  var jsxRuntime = require('react/jsx-runtime');
9
8
 
10
9
  var TimeSlider = function TimeSlider(_ref) {
@@ -58,16 +57,16 @@ var TimeSlider = function TimeSlider(_ref) {
58
57
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
59
58
  className: "flex",
60
59
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
61
- className: classNames(Date_module.dateHeader, "flex-1 font-medium text-muted text-sm p-1 mx-px text-center bg-tint-50"),
60
+ className: classNames("fabric-dateHeader", "flex-1 font-medium text-muted text-sm p-1 mx-px text-center bg-tint-50"),
62
61
  children: "H"
63
62
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
64
- className: classNames(Date_module.dateHeader, "flex-1 font-medium text-muted text-sm p-1 mx-px text-center bg-tint-50"),
63
+ className: classNames("fabric-dateHeader", "flex-1 font-medium text-muted text-sm p-1 mx-px text-center bg-tint-50"),
65
64
  children: "M"
66
65
  })]
67
66
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
68
- className: "flex flex-1 flex-nowrap overflow-hidden relative",
67
+ className: "flex flex-1 flex-nowrap items-stretch overflow-hidden relative",
69
68
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
70
- className: classNames("flex-1 overflow-auto scroll-hide snap-y snap-mandatory", Date_module.timeSlider),
69
+ className: classNames("flex-1 overflow-auto scroll-hide snap-y snap-mandatory", "fabric-date-timeSlider"),
71
70
  onScroll: calculateTime,
72
71
  ref: hourRef,
73
72
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -92,7 +91,7 @@ var TimeSlider = function TimeSlider(_ref) {
92
91
  className: "w-full"
93
92
  })]
94
93
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
95
- className: classNames("flex-1 overflow-auto scroll-hide snap-y snap-mandatory", Date_module.timeSlider),
94
+ className: classNames("flex-1 overflow-auto scroll-hide snap-y snap-mandatory", "fabric-date-timeSlider"),
96
95
  onScroll: calculateTime,
97
96
  ref: minuteRef,
98
97
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -9,7 +9,6 @@ import { DateUtil } from '../utils/dateUtil.js';
9
9
  import { DateCell } from './DateCell.js';
10
10
  import classNames from 'classnames';
11
11
  import { PageType } from '../types/index.js';
12
- import classes from './Date.module.css';
13
12
  import { jsxs, jsx } from 'react/jsx-runtime';
14
13
 
15
14
  var _excluded = ["pageDate", "isHijri"];
@@ -29,11 +28,11 @@ var DatePage = function DatePage(_ref) {
29
28
  return /*#__PURE__*/jsxs("div", {
30
29
  className: classNames("grid grid-cols-8 area-content", props.page !== PageType.DATE && "invisible"),
31
30
  children: [/*#__PURE__*/jsx("div", {
32
- className: classNames(classes.dateHeader, "px-1 text-center bg-tint-50 h-7")
31
+ className: classNames("fabric-dateHeader", "px-1 text-center bg-tint-50 h-7")
33
32
  }), cols.map(function (col) {
34
33
  var dt = DateUtil.addDays(startDate, col, isHijri);
35
34
  return /*#__PURE__*/jsx("div", {
36
- className: classNames(classes.dateHeader, "font-medium text-sm p-1 mx-px text-center text-muted bg-tint-50 h-7"),
35
+ className: classNames("fabric-dateHeader", "font-medium text-sm p-1 mx-px text-center text-muted bg-tint-50 h-7"),
37
36
  children: DateUtil.format(dt, "eeeeee", i18next.language, isHijri)
38
37
  }, dt.toISOString());
39
38
  }), rows.map(function (row) {
@@ -4,7 +4,6 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
4
  import { useDebounce } from '@react-fabric/core';
5
5
  import classNames from 'classnames';
6
6
  import { useRef, useState, useEffect, useCallback } from 'react';
7
- import classes from './Date.module.css';
8
7
  import { jsxs, jsx } from 'react/jsx-runtime';
9
8
 
10
9
  var TimeSlider = function TimeSlider(_ref) {
@@ -58,16 +57,16 @@ var TimeSlider = function TimeSlider(_ref) {
58
57
  children: [/*#__PURE__*/jsxs("div", {
59
58
  className: "flex",
60
59
  children: [/*#__PURE__*/jsx("div", {
61
- className: classNames(classes.dateHeader, "flex-1 font-medium text-muted text-sm p-1 mx-px text-center bg-tint-50"),
60
+ className: classNames("fabric-dateHeader", "flex-1 font-medium text-muted text-sm p-1 mx-px text-center bg-tint-50"),
62
61
  children: "H"
63
62
  }), /*#__PURE__*/jsx("div", {
64
- className: classNames(classes.dateHeader, "flex-1 font-medium text-muted text-sm p-1 mx-px text-center bg-tint-50"),
63
+ className: classNames("fabric-dateHeader", "flex-1 font-medium text-muted text-sm p-1 mx-px text-center bg-tint-50"),
65
64
  children: "M"
66
65
  })]
67
66
  }), /*#__PURE__*/jsxs("div", {
68
- className: "flex flex-1 flex-nowrap overflow-hidden relative",
67
+ className: "flex flex-1 flex-nowrap items-stretch overflow-hidden relative",
69
68
  children: [/*#__PURE__*/jsxs("div", {
70
- className: classNames("flex-1 overflow-auto scroll-hide snap-y snap-mandatory", classes.timeSlider),
69
+ className: classNames("flex-1 overflow-auto scroll-hide snap-y snap-mandatory", "fabric-date-timeSlider"),
71
70
  onScroll: calculateTime,
72
71
  ref: hourRef,
73
72
  children: [/*#__PURE__*/jsx("div", {
@@ -92,7 +91,7 @@ var TimeSlider = function TimeSlider(_ref) {
92
91
  className: "w-full"
93
92
  })]
94
93
  }), /*#__PURE__*/jsxs("div", {
95
- className: classNames("flex-1 overflow-auto scroll-hide snap-y snap-mandatory", classes.timeSlider),
94
+ className: classNames("flex-1 overflow-auto scroll-hide snap-y snap-mandatory", "fabric-date-timeSlider"),
96
95
  onScroll: calculateTime,
97
96
  ref: minuteRef,
98
97
  children: [/*#__PURE__*/jsx("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/date",
3
- "version": "1.0.0-beta.36",
3
+ "version": "1.0.0-beta.37",
4
4
  "description": "RUF: Date package",
5
5
  "author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
6
6
  "license": "MIT",
@@ -11,12 +11,23 @@
11
11
  "types": "dist/types/index.d.ts",
12
12
  "directories": {
13
13
  "src": "src",
14
+ "styles": "css",
14
15
  "test": "tests"
15
16
  },
16
17
  "files": [
18
+ "css",
17
19
  "src",
18
20
  "dist"
19
21
  ],
22
+ "exports": {
23
+ ".": {
24
+ "default": "./dist/esm/index.js",
25
+ "import": "./dist/esm/index.js",
26
+ "require": "./dist/cjs/index.js",
27
+ "types": "./dist/types/index.d.ts"
28
+ },
29
+ "./styles": "./css/styles.css"
30
+ },
20
31
  "publishConfig": {
21
32
  "access": "public",
22
33
  "registry": "https://registry.npmjs.org/"
@@ -33,8 +44,8 @@
33
44
  "watch": "npm-run-all -p watch:rollup watch:dts"
34
45
  },
35
46
  "dependencies": {
36
- "@react-fabric/core": "^1.0.0-beta.36",
37
- "@react-fabric/utilities": "^1.0.0-beta.36",
47
+ "@react-fabric/core": "^1.0.0-beta.37",
48
+ "@react-fabric/utilities": "^1.0.0-beta.37",
38
49
  "classnames": "^2.5.1",
39
50
  "date-fns": "^4.0.0",
40
51
  "resize-observer-polyfill": "^1.5.1"
@@ -52,5 +63,5 @@
52
63
  "node": ">=18.12.0",
53
64
  "npm": ">=8.19.0"
54
65
  },
55
- "gitHead": "91a7cce216e21cbc6406226d8c3f56a1a26e410a"
66
+ "gitHead": "9b737229bf24ebe986540ee2c4b8904ebc4a5a9b"
56
67
  }
@@ -28,7 +28,6 @@ import { DateUtil } from "../utils/dateUtil";
28
28
  import { DateCell, type DateCellProps } from "./DateCell";
29
29
  import classNames from "classnames";
30
30
  import { PageType } from "../types";
31
- import classes from "./Date.module.css";
32
31
 
33
32
  const rows = [0, 1, 2, 3, 4, 5];
34
33
  const cols = [0, 1, 2, 3, 4, 5, 6];
@@ -57,7 +56,7 @@ export const DatePage = ({ pageDate, isHijri, ...props }: Props) => {
57
56
  >
58
57
  <div
59
58
  className={classNames(
60
- classes.dateHeader,
59
+ "fabric-dateHeader",
61
60
  "px-1 text-center bg-tint-50 h-7",
62
61
  )}
63
62
  ></div>
@@ -67,7 +66,7 @@ export const DatePage = ({ pageDate, isHijri, ...props }: Props) => {
67
66
  <div
68
67
  key={dt.toISOString()}
69
68
  className={classNames(
70
- classes.dateHeader,
69
+ "fabric-dateHeader",
71
70
  "font-medium text-sm p-1 mx-px text-center text-muted bg-tint-50 h-7",
72
71
  )}
73
72
  >
@@ -24,7 +24,6 @@
24
24
  import { useDebounce } from "@react-fabric/core";
25
25
  import classNames from "classnames";
26
26
  import { useCallback, useEffect, useRef, useState } from "react";
27
- import classes from "./Date.module.css";
28
27
 
29
28
  interface Props {
30
29
  hour: number;
@@ -80,7 +79,7 @@ export const TimeSlider = ({ hour = 0, minute = 0, onTimeChange }: Props) => {
80
79
  <div className="flex">
81
80
  <div
82
81
  className={classNames(
83
- classes.dateHeader,
82
+ "fabric-dateHeader",
84
83
  "flex-1 font-medium text-muted text-sm p-1 mx-px text-center bg-tint-50",
85
84
  )}
86
85
  >
@@ -88,18 +87,18 @@ export const TimeSlider = ({ hour = 0, minute = 0, onTimeChange }: Props) => {
88
87
  </div>
89
88
  <div
90
89
  className={classNames(
91
- classes.dateHeader,
90
+ "fabric-dateHeader",
92
91
  "flex-1 font-medium text-muted text-sm p-1 mx-px text-center bg-tint-50",
93
92
  )}
94
93
  >
95
94
  M
96
95
  </div>
97
96
  </div>
98
- <div className="flex flex-1 flex-nowrap overflow-hidden relative">
97
+ <div className="flex flex-1 flex-nowrap items-stretch overflow-hidden relative">
99
98
  <div
100
99
  className={classNames(
101
100
  "flex-1 overflow-auto scroll-hide snap-y snap-mandatory",
102
- classes.timeSlider,
101
+ "fabric-date-timeSlider",
103
102
  )}
104
103
  onScroll={calculateTime}
105
104
  ref={hourRef}
@@ -144,7 +143,7 @@ export const TimeSlider = ({ hour = 0, minute = 0, onTimeChange }: Props) => {
144
143
  <div
145
144
  className={classNames(
146
145
  "flex-1 overflow-auto scroll-hide snap-y snap-mandatory",
147
- classes.timeSlider,
146
+ "fabric-date-timeSlider",
148
147
  )}
149
148
  onScroll={calculateTime}
150
149
  ref={minuteRef}
@@ -1 +0,0 @@
1
- @layer comp{.dateHeader{box-shadow:inset 0 -1px 0 theme(colors.tint.200/50%)}.timeSlider{height:11.25rem;&:after,&:before{box-shadow:0 0 3rem .25rem theme(colors.tint.600);content:"";display:block;z-index:10}&:before{position:sticky;top:0}&:after{bottom:0;position:sticky}&>:first-child,&>:last-child{height:calc(50% - .75rem)}& [data-skew="1"]>div{opacity:.9;transform:scaleY(.9)}& [data-skew="2"]>div{opacity:.75;transform:scaleY(.75)}& [data-skew="3"]>div{opacity:.65;transform:scaleY(.65)}& [data-skew="4"]>div{opacity:.5;transform:scaleY(.5)}}}
@@ -1 +0,0 @@
1
- @layer comp{.dateHeader{box-shadow:inset 0 -1px 0 theme(colors.tint.200/50%)}.timeSlider{height:11.25rem;&:after,&:before{box-shadow:0 0 3rem .25rem theme(colors.tint.600);content:"";display:block;z-index:10}&:before{position:sticky;top:0}&:after{bottom:0;position:sticky}&>:first-child,&>:last-child{height:calc(50% - .75rem)}& [data-skew="1"]>div{opacity:.9;transform:scaleY(.9)}& [data-skew="2"]>div{opacity:.75;transform:scaleY(.75)}& [data-skew="3"]>div{opacity:.65;transform:scaleY(.65)}& [data-skew="4"]>div{opacity:.5;transform:scaleY(.5)}}}