solara/lib/core/dashboard/component/AddFieldSheet.js in solara-0.2.2 vs solara/lib/core/dashboard/component/AddFieldSheet.js in solara-0.2.3
- old
+ new
@@ -15,153 +15,116 @@
this.overlay.onclick = () => this.hideAddFieldForm();
}
render() {
this.shadowRoot.innerHTML = `
- <style>
- .bottom-sheet {
- position: fixed;
- bottom: -100%;
- left: 0;
- right: 0;
- background-color: white;
- padding: 30px;
- box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
- transition: bottom 0.3s ease-out;
- z-index: 1000;
- border-top-left-radius: 25px;
- border-top-right-radius: 25px;
- height: 60vh;
- max-height: 500px;
- overflow-y: auto;
- max-width: 600px;
- margin: 0 auto;
- }
- .bottom-sheet.show {
- bottom: 0;
- }
- .bottom-sheet h3 {
- color: var(--primary-color);
- margin-top: 0;
- margin-bottom: 20px;
- font-size: 24px;
- }
- .overlay {
- display: none;
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.5);
- z-index: 999;
- }
- .show {
- display: block;
- }
- .form-group {
- margin-bottom: 20px;
- }
- .form-group label {
- display: block;
- margin-bottom: 8px;
- font-weight: bold;
- }
- .form-group input {
- width: 100%;
- padding: 12px;
- border: 1px solid var(--border-color);
- border-radius: 4px;
- font-size: 16px;
- }
- .tooltip {
- position: relative;
- display: inline-block;
- margin-left: 5px;
- }
- .tooltip .tooltiptext {
- visibility: hidden;
- width: 200px;
- background-color: #555;
- color: #fff;
- text-align: center;
- border-radius: 6px;
- padding: 5px;
- position: absolute;
- z-index: 1;
- bottom: 125%;
- left: 50%;
- transform: translateX(-50%);
- opacity: 0;
- transition: opacity 0.3s;
- }
- .tooltip:hover .tooltiptext {
- visibility: visible;
- opacity: 1;
- }
- .add-field-button {
- width: 100%;
- padding: 15px;
- font-size: 18px;
- background-color: var(--primary-color);
- color: white;
- border: none;
- border-radius: 4px;
- cursor: pointer;
- transition: background-color 0.3s ease;
- }
- .add-field-button:hover {
- background-color: #3A7BC8;
- }
- .color-picker-container {
- display: none;
- margin-top: 10px;
- }
- #fieldValue[type="color"] {
- -webkit-appearance: none;
- border: none;
- width: 32px;
- height: 32px;
- cursor: pointer;
- }
- #fieldValue[type="color"]::-webkit-color-swatch-wrapper {
- padding: 0;
- }
- #fieldValue[type="color"]::-webkit-color-swatch {
- border: none;
- }
- #colorPicker {
- -webkit-appearance: none; /* Remove default styling */
- border: none; /* No border */
- width: 100%; /* Set a fixed width */
- height: 60px; /* Increase the height */
- cursor: pointer; /* Pointer cursor on hover */
- border-radius: 4px; /* Optional: Rounded corners */
- }
+ <style>
+ .bottom-sheet {
+ position: fixed;
+ bottom: -100%;
+ left: 0;
+ right: 0;
+ background-color: white;
+ padding: 21px;
+ box-shadow: 0 -3.5px 14px rgba(0, 0, 0, 0.2);
+ transition: bottom 0.3s ease-out;
+ z-index: 1000;
+ border-top-left-radius: 17.5px;
+ border-top-right-radius: 17.5px;
+ height: 42vh;
+ max-height: 350px;
+ overflow-y: auto;
+ max-width: 420px;
+ margin: 0 auto;
+ }
+ .bottom-sheet.show {
+ bottom: 0;
+ }
+ .bottom-sheet h3 {
+ color: var(--primary-color);
+ margin-top: 0;
+ margin-bottom: 14px;
+ font-size: 16.8px;
+ }
+ .overlay {
+ display: none;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.5);
+ z-index: 999;
+ }
+ .show {
+ display: block;
+ }
+ .form-group {
+ margin-bottom: 14px;
+ }
+ .form-group label {
+ display: block;
+ margin-bottom: 5.6px;
+ font-weight: bold;
+ font-size: 11.2px;
+ }
+ .form-group input {
+ width: 100%;
+ padding: 8.4px;
+ border: 1px solid var(--border-color);
+ border-radius: 2.8px;
+ font-size: 11.2px;
+ }
+ .add-field-button {
+ width: 100%;
+ padding: 10.5px;
+ font-size: 12.6px;
+ background-color: var(--primary-color);
+ color: white;
+ border: none;
+ border-radius: 2.8px;
+ cursor: pointer;
+ transition: background-color 0.3s ease;
+ }
+ .add-field-button:hover {
+ background-color: #3A7BC8;
+ }
+ .color-picker-container {
+ display: none;
+ margin-top: 7px;
+ }
+ #colorPicker {
+ -webkit-appearance: none;
+ border: none;
+ width: 100%;
+ height: 42px;
+ cursor: pointer;
+ border-radius: 2.8px;
+ }
+ #colorPicker::-webkit-color-swatch {
+ border: none;
+ border-radius: 2.8px;
+ }
+</style>
- #colorPicker::-webkit-color-swatch {
- border: none; /* No border on the color swatch */
- border-radius: 4px; /* Optional: Rounded corners */
- }
- </style>
- <div id="overlay" class="overlay"></div>
- <div class="bottom-sheet" id="addFieldSheet">
- <h3>Add New Field</h3>
- <form id="addFieldForm">
- <div class="form-group">
- <label for="fieldName">Field Name</label>
- <input type="text" id="fieldName" name="fieldName" required>
- </div>
- <div class="form-group">
- <label for="fieldValue">Field Value</label>
- <input type="text" id="fieldValue" name="fieldValue" required>
- <div class="color-picker-container">
- <input type="color" id="colorPicker" name="colorPicker">
- </div>
- </div>
- <button type="submit" class="add-field-button">Add Field</button>
- </form>
+<div id="overlay" class="overlay"></div>
+<div class="bottom-sheet" id="addFieldSheet">
+ <h3>Add New Field</h3>
+ <form id="addFieldForm">
+ <div class="form-group">
+ <label for="fieldName">Field Name</label>
+ <input type="text" id="fieldName" name="fieldName" required>
+ </div>
+ <div class="form-group">
+ <label for="fieldValue">Field Value</label>
+ <input type="text" id="fieldValue" name="fieldValue" required>
+ <div class="color-picker-container">
+ <input type="color" id="colorPicker" name="colorPicker">
</div>
+ </div>
+ <button type="submit" class="add-field-button">Add Field</button>
+ </form>
+</div>
`;
}
show(inputType, onSubmit) {
this.onSubmit = onSubmit;
\ No newline at end of file