@campfire-interactive/inputs 0.1.0 → 0.1.1
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/index.js +27 -0
- package/package.json +40 -40
package/dist/index.js
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
import ReactDatePicker from "react-datepicker";
|
|
3
3
|
import { format as fmt, parse as parseDate, isValid } from "date-fns";
|
|
4
4
|
import "react-datepicker/dist/react-datepicker.css";
|
|
5
|
+
|
|
6
|
+
// #style-inject:#style-inject
|
|
7
|
+
function styleInject(css, { insertAt } = {}) {
|
|
8
|
+
if (!css || typeof document === "undefined") return;
|
|
9
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
10
|
+
const style = document.createElement("style");
|
|
11
|
+
style.type = "text/css";
|
|
12
|
+
if (insertAt === "top") {
|
|
13
|
+
if (head.firstChild) {
|
|
14
|
+
head.insertBefore(style, head.firstChild);
|
|
15
|
+
} else {
|
|
16
|
+
head.appendChild(style);
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
head.appendChild(style);
|
|
20
|
+
}
|
|
21
|
+
if (style.styleSheet) {
|
|
22
|
+
style.styleSheet.cssText = css;
|
|
23
|
+
} else {
|
|
24
|
+
style.appendChild(document.createTextNode(css));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/DatePicker.css
|
|
29
|
+
styleInject('.cfi-datepicker-wrapper {\n display: block;\n width: 100%;\n}\n.cfi-datepicker-wrapper .react-datepicker__input-container {\n display: block;\n width: 100%;\n}\n.cfi-datepicker-wrapper .react-datepicker__input-container input {\n box-sizing: border-box;\n display: block;\n height: 2.25rem;\n width: 100%;\n padding: 0.25rem 2rem 0.25rem 0.75rem;\n border: 1px solid hsl(214.3 31.8% 91.4%);\n border-radius: 0.375rem;\n background-color: hsl(0 0% 100%);\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: inherit;\n outline: none;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n.cfi-datepicker-wrapper .react-datepicker__input-container input::placeholder {\n color: hsl(215.4 16.3% 56.9%);\n}\n.cfi-datepicker-wrapper .react-datepicker__input-container input:focus,\n.cfi-datepicker-wrapper .react-datepicker__input-container input:focus-visible {\n border-color: hsl(222.2 47.4% 30%);\n box-shadow: 0 0 0 2px hsl(222.2 47.4% 30% / 0.15);\n}\n.cfi-datepicker-wrapper .react-datepicker__input-container input:disabled {\n background-color: hsl(210 40% 96.1%);\n color: hsl(215.4 16.3% 46.9%);\n cursor: not-allowed;\n}\n.cfi-datepicker-wrapper .react-datepicker__close-icon {\n position: absolute;\n right: 0.5rem;\n top: 50%;\n transform: translateY(-50%);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 1.25rem;\n width: 1.25rem;\n padding: 0;\n background: transparent;\n border: none;\n cursor: pointer;\n}\n.cfi-datepicker-wrapper .react-datepicker__close-icon::after {\n content: "\\d7";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 1.25rem;\n width: 1.25rem;\n padding: 0;\n background: transparent;\n border-radius: 0.25rem;\n color: hsl(215.4 16.3% 46.9%);\n font-size: 1.125rem;\n font-weight: 400;\n line-height: 1;\n transition: background-color 0.15s ease, color 0.15s ease;\n}\n.cfi-datepicker-wrapper .react-datepicker__close-icon:hover::after {\n background-color: hsl(210 40% 94%);\n color: hsl(222.2 84% 4.9%);\n}\n');
|
|
30
|
+
|
|
31
|
+
// src/DatePicker.tsx
|
|
5
32
|
import { jsx } from "react/jsx-runtime";
|
|
6
33
|
var MODE_DEFAULTS = {
|
|
7
34
|
date: { format: "yyyy-MM-dd", placeholder: "YYYY-MM-DD" },
|
package/package.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@campfire-interactive/inputs",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Shared input components for Campfire Suite (date picker, etc.)",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.js"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsup",
|
|
19
|
-
"dev": "tsup --watch"
|
|
20
|
-
},
|
|
21
|
-
"peerDependencies": {
|
|
22
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
23
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"date-fns": "^4.1.0",
|
|
27
|
-
"react-datepicker": "^9.1.0"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@types/react": "^19.0.0",
|
|
31
|
-
"react": "^19.0.0",
|
|
32
|
-
"react-dom": "^19.0.0",
|
|
33
|
-
"tsup": "^8.0.0",
|
|
34
|
-
"typescript": "^5.0.0"
|
|
35
|
-
},
|
|
36
|
-
"publishConfig": {
|
|
37
|
-
"registry": "https://registry.npmjs.org",
|
|
38
|
-
"access": "public"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@campfire-interactive/inputs",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Shared input components for Campfire Suite (date picker, etc.)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsup",
|
|
19
|
+
"dev": "tsup --watch"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
23
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"date-fns": "^4.1.0",
|
|
27
|
+
"react-datepicker": "^9.1.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/react": "^19.0.0",
|
|
31
|
+
"react": "^19.0.0",
|
|
32
|
+
"react-dom": "^19.0.0",
|
|
33
|
+
"tsup": "^8.0.0",
|
|
34
|
+
"typescript": "^5.0.0"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"registry": "https://registry.npmjs.org",
|
|
38
|
+
"access": "public"
|
|
39
|
+
}
|
|
40
|
+
}
|