@dot-system/css-utility 0.1.0

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.
@@ -0,0 +1 @@
1
+ @layer dots-css-utility, dots-css-utility.core;
package/lib/index.js ADDED
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "clsx", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _clsx.clsx;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "cn", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _cn.cn;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "csv", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _csv.csv;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "cva", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _cva.cva;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "dotMerge", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _dotMerge.dotMerge;
34
+ }
35
+ });
36
+
37
+ var _cva = require("./js/cva");
38
+
39
+ var _clsx = require("./js/clsx");
40
+
41
+ var _cn = require("./js/cn");
42
+
43
+ var _dotMerge = require("./js/dotMerge");
44
+
45
+ var _csv = require("./js/csv");
package/lib/js/clsx.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.clsx = void 0;
7
+
8
+ var _clsx = _interopRequireDefault(require("clsx"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+
12
+ var clsx = function clsx() {
13
+ return _clsx["default"].apply(void 0, arguments);
14
+ };
15
+
16
+ exports.clsx = clsx;
package/lib/js/cn.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.cn = void 0;
7
+
8
+ var _clsx = require("clsx");
9
+
10
+ var _dotMerge = require("./dotMerge");
11
+
12
+ var cn = function cn() {
13
+ return (0, _dotMerge.dotMerge)(_clsx.clsx.apply(void 0, arguments));
14
+ };
15
+
16
+ exports.cn = cn;
package/lib/js/csv.js ADDED
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.csv = void 0;
7
+
8
+ // const buttonSlots = createSlotVariants({
9
+ // root: cva("d-inline-flex d-items-center", {
10
+ // variants: {
11
+ // size: {
12
+ // sm: "d-h-8 d-px-3",
13
+ // lg: "d-h-12 d-px-6"
14
+ // }
15
+ // }
16
+ // }),
17
+ // icon: cva("", {
18
+ // variants: {
19
+ // size: {
20
+ // sm: "d-w-3",
21
+ // lg: "d-w-5"
22
+ // }
23
+ // }
24
+ // })
25
+ // })
26
+ var csv = function csv(slots) {
27
+ return function (props) {
28
+ var result = {};
29
+
30
+ for (var key in slots) {
31
+ result[key] = slots[key](props);
32
+ }
33
+
34
+ return result;
35
+ };
36
+ };
37
+
38
+ exports.csv = csv;
package/lib/js/cva.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.cva = void 0;
7
+
8
+ var _classVarianceAuthority = require("class-variance-authority");
9
+
10
+ var cva = function cva() {
11
+ return _classVarianceAuthority.cva.apply(void 0, arguments);
12
+ };
13
+
14
+ exports.cva = cva;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.dotMerge = void 0;
7
+
8
+ var _tailwindMerge = require("tailwind-merge");
9
+
10
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
+
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+
14
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+
16
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
17
+
18
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
19
+
20
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
21
+
22
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
23
+
24
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
25
+
26
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
27
+
28
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
29
+
30
+ /**
31
+ * dotMerge is a custom tailwind-merge instance for d- prefixed utilities.
32
+ *
33
+ * It uses the default Tailwind config but applies all conflict detection
34
+ * and merging rules to classes that use the d- prefix instead of the default prefix.
35
+ *
36
+ * How it works:
37
+ * 1. Takes the default Tailwind class groups (position, display, padding, etc.)
38
+ * 2. Prefixes all class names with "d-"
39
+ * 3. Applies the same conflict resolution rules
40
+ *
41
+ * Example: cn('d-fixed', 'd-relative') → 'd-relative'
42
+ */
43
+ var dotMerge = (0, _tailwindMerge.createTailwindMerge)(function () {
44
+ var config = (0, _tailwindMerge.getDefaultConfig)();
45
+ var transformedClassGroups = Object.fromEntries(Object.entries(config.classGroups).map(function (_ref) {
46
+ var _ref2 = _slicedToArray(_ref, 2),
47
+ groupId = _ref2[0],
48
+ matchers = _ref2[1];
49
+
50
+ return [groupId, matchers.map(function (matcher) {
51
+ if (typeof matcher === "string") {
52
+ return "d-".concat(matcher);
53
+ }
54
+
55
+ if (matcher instanceof RegExp) {
56
+ var source = matcher.source.replace(/^\^/, "");
57
+ return new RegExp("^d-".concat(source), matcher.flags);
58
+ }
59
+
60
+ if (_typeof(matcher) === "object") {
61
+ return Object.fromEntries(Object.entries(matcher).map(function (_ref3) {
62
+ var _ref4 = _slicedToArray(_ref3, 2),
63
+ key = _ref4[0],
64
+ value = _ref4[1];
65
+
66
+ return ["d-".concat(key), value];
67
+ }));
68
+ }
69
+
70
+ return matcher;
71
+ })];
72
+ }));
73
+ return _objectSpread(_objectSpread({}, config), {}, {
74
+ classGroups: transformedClassGroups
75
+ });
76
+ });
77
+ exports.dotMerge = dotMerge;