@constructor-io/constructorio-ui-autocomplete 1.2.1 → 1.2.2
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/README.md +2 -2
- package/lib/cjs/constants.js +2 -2
- package/lib/mjs/constants.js +2 -2
- package/lib/{cjs/components/Autocomplete/Autocomplete.css → styles.css} +0 -0
- package/lib/types/constants.d.ts +1 -1
- package/package.json +4 -4
- package/lib/mjs/components/Autocomplete/Autocomplete.css +0 -110
package/README.md
CHANGED
|
@@ -106,13 +106,13 @@ By default, importing react components or hooks from this library does not pull
|
|
|
106
106
|
If you wish to use some starter styles from this library, add an import statement similar to the example import statement below:
|
|
107
107
|
|
|
108
108
|
```js
|
|
109
|
-
import '
|
|
109
|
+
import '@constructor-io/constructorio-ui-autocomplete/styles.css';
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
> Note: the path and syntax in this example may change slightly depending on your module bundling strategy
|
|
113
113
|
|
|
114
114
|
- These starter styles can be used as a foundation to build on top of, or just as a reference for you to replace completely.
|
|
115
|
-
- To opt out of all default styling, do not import the `
|
|
115
|
+
- To opt out of all default styling, do not import the `styles.css` stylesheet.
|
|
116
116
|
- All starter styles in this library are scoped within the `.cio-autocomplete` css selector.
|
|
117
117
|
- These starter styles are intended to be extended by layering in your own css rules
|
|
118
118
|
- If you like, you can override the container's className like so:
|
package/lib/cjs/constants.js
CHANGED
|
@@ -125,12 +125,12 @@ By default, importing react components or hooks from this library does not pull
|
|
|
125
125
|
If you wish to use some starter styles from this library, add an import statement similar to the example import statement below:
|
|
126
126
|
|
|
127
127
|
\`
|
|
128
|
-
import '
|
|
128
|
+
import '@constructor-io/constructorio-ui-autocomplete/styles.css';
|
|
129
129
|
\`
|
|
130
130
|
|
|
131
131
|
<i></i>
|
|
132
132
|
|
|
133
|
-
- To opt out of all default styling, do not import the \`
|
|
133
|
+
- To opt out of all default styling, do not import the \`styles.css\` stylesheet.
|
|
134
134
|
- The path and syntax in the example above may change depending on your module bundling strategy
|
|
135
135
|
- These starter styles can be used as a foundation to build on top of, or just as a reference for you to replace completely.
|
|
136
136
|
- All starter styles in this library are scoped within the \`.cio-autocomplete\` css selector.
|
package/lib/mjs/constants.js
CHANGED
|
@@ -121,12 +121,12 @@ By default, importing react components or hooks from this library does not pull
|
|
|
121
121
|
If you wish to use some starter styles from this library, add an import statement similar to the example import statement below:
|
|
122
122
|
|
|
123
123
|
\`
|
|
124
|
-
import '
|
|
124
|
+
import '@constructor-io/constructorio-ui-autocomplete/styles.css';
|
|
125
125
|
\`
|
|
126
126
|
|
|
127
127
|
<i></i>
|
|
128
128
|
|
|
129
|
-
- To opt out of all default styling, do not import the \`
|
|
129
|
+
- To opt out of all default styling, do not import the \`styles.css\` stylesheet.
|
|
130
130
|
- The path and syntax in the example above may change depending on your module bundling strategy
|
|
131
131
|
- These starter styles can be used as a foundation to build on top of, or just as a reference for you to replace completely.
|
|
132
132
|
- All starter styles in this library are scoped within the \`.cio-autocomplete\` css selector.
|
|
File without changes
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ export declare const onSubmitDefault: (submitEvent: AutocompleteSubmitEvent) =>
|
|
|
22
22
|
export declare const zeroStateSectionsDescription = "Use `zeroStateSections` to show suggestions after a user applies focus to the search input field and before they start typing a query";
|
|
23
23
|
export declare const openOnFocusDescription = "Use `openOnFocus: false` to show suggestions after a user clears their query, but not when they initially apply focus to the search input field";
|
|
24
24
|
export declare const multipleSectionsDescription = "Use as many different `recommendations` and `custom` sections as you'd like and in whatever order you would like!";
|
|
25
|
-
export declare const customStylesDescription = "\nBy default, importing react components or hooks from this library does not pull any css into your project.\n\nIf you wish to use some starter styles from this library, add an import statement similar to the example import statement below:\n\n`\nimport '
|
|
25
|
+
export declare const customStylesDescription = "\nBy default, importing react components or hooks from this library does not pull any css into your project.\n\nIf you wish to use some starter styles from this library, add an import statement similar to the example import statement below:\n\n`\nimport '@constructor-io/constructorio-ui-autocomplete/styles.css';\n`\n\n<i></i>\n\n- To opt out of all default styling, do not import the `styles.css` stylesheet.\n- The path and syntax in the example above may change depending on your module bundling strategy\n- These starter styles can be used as a foundation to build on top of, or just as a reference for you to replace completely.\n- All starter styles in this library are scoped within the `.cio-autocomplete` css selector.\n- These starter styles are intended to be extended by layering in your own css rules\n- If you like, you can override the container's className like so:\n`autocompleteClassName='custom-autocomplete-container'`\n- If you like, you can pass additional className(s) of your choosing like so:\n`autocompleteClassName='cio-autocomplete custom-autocomplete-container'`\n\n\n```css\n/* Custom Style Sheet */\n.cio-autocomplete.custom-autocomplete-styles form {\n height: 44px;\n width: 600px;\n border-radius: 8px;\n background-color: rgb(247, 247, 247);\n}\n\n.cio-autocomplete.custom-autocomplete-styles .cio-input {\n font-weight: bold;\n}\n\n.cio-autocomplete.custom-autocomplete-styles .cio-form button {\n width: 44px;\n}\n\n.cio-autocomplete.custom-autocomplete-styles .cio-clear-btn {\n right: 24px;\n}\n\n.cio-autocomplete.custom-autocomplete-styles .cio-sectionName {\n margin: 5px 3px;\n}\n\n.cio-autocomplete.custom-autocomplete-styles .cio-results {\n width: 620px;\n max-height: 334px;\n overflow: hidden;\n border-radius: 0px 0px 8px 8px;\n color: rgb(51, 51, 51);\n}\n\n.cio-autocomplete.custom-autocomplete-styles .Products p {\n padding: 5px 5px 0;\n}\n```\n";
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructor-io/constructorio-ui-autocomplete",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Constructor.io Autocomplete UI library for web applications",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
7
7
|
"exports": {
|
|
8
|
+
"./styles.css": "./lib/styles.css",
|
|
8
9
|
".": {
|
|
9
10
|
"import": "./lib/mjs/index.js",
|
|
10
11
|
"require": "./lib/cjs/index.js"
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
"types": "lib/types/index.d.ts",
|
|
15
16
|
"scripts": {
|
|
16
17
|
"lint": "eslint src --ext js,ts,jsx,tsx",
|
|
17
|
-
"copy-
|
|
18
|
+
"copy-styles": "cp src/styles.css lib/styles.css",
|
|
18
19
|
"prepare": "husky install",
|
|
19
20
|
"dev": "storybook dev -p 6006",
|
|
20
21
|
"storybook:ci": "storybook dev --ci --quiet -p 6006",
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
"build-storybook": "storybook build -o 'docs'",
|
|
25
26
|
"serve-built-storybook": "npx http-server docs",
|
|
26
27
|
"version": "npm run build-storybook && git add -u ./docs && git add ./docs/* && npm run compile",
|
|
27
|
-
"compile": "rm -rf lib && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && npm run copy-
|
|
28
|
+
"compile": "rm -rf lib && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && npm run copy-styles"
|
|
28
29
|
},
|
|
29
30
|
"author": "constructor.io",
|
|
30
31
|
"license": "MIT",
|
|
@@ -58,7 +59,6 @@
|
|
|
58
59
|
"@types/react-dom": "^18.0.6",
|
|
59
60
|
"@typescript-eslint/eslint-plugin": "^5.38.0",
|
|
60
61
|
"@typescript-eslint/parser": "^5.38.0",
|
|
61
|
-
"copyfiles": "^2.4.1",
|
|
62
62
|
"downshift": "^7.0.5",
|
|
63
63
|
"eslint": "^8.23.1",
|
|
64
64
|
"eslint-config-airbnb": "^19.0.4",
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/* Autosuggest Container */
|
|
2
|
-
.cio-autocomplete {
|
|
3
|
-
position: relative;
|
|
4
|
-
height: 2rem;
|
|
5
|
-
padding: 20px;
|
|
6
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/* Autosuggest Form */
|
|
10
|
-
.cio-autocomplete .cio-form {
|
|
11
|
-
position: relative;
|
|
12
|
-
height: 100%;
|
|
13
|
-
width: 24rem;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.cio-autocomplete .cio-input {
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: 100%;
|
|
19
|
-
border: 1px solid gray;
|
|
20
|
-
padding: 0 10px;
|
|
21
|
-
border-radius: 3px;
|
|
22
|
-
font-size: 1rem;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.cio-autocomplete .cio-submit-btn,
|
|
26
|
-
.cio-autocomplete .cio-clear-btn {
|
|
27
|
-
position: absolute;
|
|
28
|
-
top: 1px;
|
|
29
|
-
bottom: -1px;
|
|
30
|
-
right: -21px;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.cio-autocomplete button:disabled {
|
|
35
|
-
cursor: not-allowed;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.cio-autocomplete .cio-submit-btn {
|
|
39
|
-
right: -21px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.cio-autocomplete .cio-clear-btn {
|
|
43
|
-
right: 10px;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.cio-autocomplete .cio-icon {
|
|
47
|
-
display: flex;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* Autosuggest Results */
|
|
52
|
-
.cio-autocomplete .cio-results {
|
|
53
|
-
position: absolute;
|
|
54
|
-
background-color: white;
|
|
55
|
-
gap: 20px;
|
|
56
|
-
padding-left: 0px;
|
|
57
|
-
list-style: none;
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-direction: row;
|
|
60
|
-
z-index: 1000;
|
|
61
|
-
margin-top: 5px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.cio-autocomplete .cio-sectionName {
|
|
65
|
-
margin: 15px 0;
|
|
66
|
-
font-size: 1rem;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.cio-autocomplete .cio-section-items {
|
|
70
|
-
padding: 0;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.cio-autocomplete .cio-item-SearchSuggestions {
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
min-width: 160px;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.cio-autocomplete .cio-item {
|
|
79
|
-
flex: 1;
|
|
80
|
-
display: flex;
|
|
81
|
-
flex-direction: column;
|
|
82
|
-
cursor: pointer;
|
|
83
|
-
list-style: none;
|
|
84
|
-
padding: 5px;
|
|
85
|
-
border-bottom: 3px solid transparent;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.cio-autocomplete .cio-item[aria-selected='true'] {
|
|
89
|
-
background-color: hsl(0, 0%, 90%);
|
|
90
|
-
border-radius: 4px;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.cio-autocomplete .Products .cio-item {
|
|
94
|
-
display: inline-flex;
|
|
95
|
-
align-items: center;
|
|
96
|
-
width: 25%;
|
|
97
|
-
height: 140px;
|
|
98
|
-
padding: 5px 0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.cio-autocomplete .cio-item p {
|
|
102
|
-
margin: 0;
|
|
103
|
-
overflow: hidden;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.cio-autocomplete .cio-item img {
|
|
107
|
-
width: 100%;
|
|
108
|
-
max-width: 100px;
|
|
109
|
-
max-height: 100px;
|
|
110
|
-
}
|