ikoncomponents 1.3.2 → 1.3.3

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.
@@ -3,12 +3,12 @@ import { Eye, SquarePen } from "lucide-react";
3
3
  import { TooltipComponent as Tooltip } from "../../tooltip";
4
4
  // Custom event component
5
5
  export default function BigCalenderEvent({ event, extraParamsEvent }) {
6
- return (_jsxs("div", { className: "custom-event flex flex-row justify-between", children: [_jsx("span", { className: "truncate", children: event.title }), _jsxs("span", { className: "flex flex-row gap-1", children: [((extraParamsEvent === null || extraParamsEvent === void 0 ? void 0 : extraParamsEvent.isEditableAll) || event.isEditable) &&
7
- _jsx(Tooltip, { tooltipContent: "Edit", children: _jsx("button", { className: "event-edit-button", onClick: (e) => {
6
+ return (_jsxs("div", { className: "custom-event flex flex-row justify-between", children: [_jsx("span", { className: "truncate w-auto", children: event.title }), _jsxs("span", { className: "flex flex-row gap-1", children: [((extraParamsEvent === null || extraParamsEvent === void 0 ? void 0 : extraParamsEvent.isEditableAll) || event.isEditable) &&
7
+ _jsx(Tooltip, { tooltipContent: "Edit", children: _jsx("button", { className: "event-edit-button w-fit px-1", onClick: (e) => {
8
8
  var _a;
9
9
  e.stopPropagation(); // Prevent triggering other event handlers
10
10
  (_a = extraParamsEvent === null || extraParamsEvent === void 0 ? void 0 : extraParamsEvent.onEditEventClick) === null || _a === void 0 ? void 0 : _a.call(extraParamsEvent, event);
11
- }, children: _jsx(SquarePen, { size: 16 }) }) }), _jsx(Tooltip, { tooltipContent: "View", children: _jsx("button", { className: "event-view-button", onClick: (e) => {
11
+ }, children: _jsx(SquarePen, { size: 16 }) }) }), _jsx(Tooltip, { tooltipContent: "View", children: _jsx("button", { className: "event-view-button w-fit px-1", onClick: (e) => {
12
12
  var _a;
13
13
  e.stopPropagation(); // Prevent triggering other event handlers
14
14
  (_a = extraParamsEvent === null || extraParamsEvent === void 0 ? void 0 : extraParamsEvent.onViewEventClick) === null || _a === void 0 ? void 0 : _a.call(extraParamsEvent, event);
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Copyright } from "lucide-react";
3
3
  export function Footer() {
4
- return (_jsx("footer", { className: "ml-12 flex border-t px-4 py-2 justify-center lg:justify-start", children: _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx(Copyright, {}), _jsx("span", { children: "Powered By" }), _jsx("a", { href: "https://keross.com", target: "_blank", children: "Keross" }), _jsx("span", { className: "", children: "|" }), _jsx("span", { id: "txtCopyrightYear", className: "", children: new Date().getFullYear() })] }) }));
4
+ return (_jsx("footer", { className: "ml-12 flex border-t px-4 py-2 justify-center lg:justify-start", children: _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx(Copyright, { className: "size-4" }), _jsx("span", { children: "Powered By" }), _jsx("a", { href: "https://keross.com", target: "_blank", children: "Keross" }), _jsx("span", { className: "", children: "|" }), _jsx("span", { id: "txtCopyrightYear", className: "", children: new Date().getFullYear() })] }) }));
5
5
  }
package/dist/index.d.ts CHANGED
@@ -131,7 +131,6 @@ export { FontProvider, useFont } from "./utils/font-provider";
131
131
  export { cn } from "./utils/cn";
132
132
  export type { CookieSessionOptionsProps } from "./utils/session/cookieSession";
133
133
  export { setCookieSession, getCookieSession, clearCookieSession, clearAllCookieSession, } from "./utils/session/cookieSession";
134
- export { getValidAccessToken, refreshAccessToken, logOut, } from "./utils/token-management";
135
- export type { AccessTokenOptionsProps } from "./utils/token-management";
134
+ export { getValidAccessToken, decodeAccessToken, logOut, refreshAccessToken } from "./utils/token-management";
136
135
  export type { TokenResponse } from "./utils/token-management/types";
137
136
  export { useIsMobile } from "./hooks/use-mobile";
package/dist/index.js CHANGED
@@ -110,5 +110,5 @@ export { RadiusProvider, useRadius } from "./utils/border-radius-provider";
110
110
  export { FontProvider, useFont } from "./utils/font-provider";
111
111
  export { cn } from "./utils/cn";
112
112
  export { setCookieSession, getCookieSession, clearCookieSession, clearAllCookieSession, } from "./utils/session/cookieSession";
113
- export { getValidAccessToken, refreshAccessToken, logOut, } from "./utils/token-management";
113
+ export { getValidAccessToken, decodeAccessToken, logOut, refreshAccessToken } from "./utils/token-management";
114
114
  export { useIsMobile } from "./hooks/use-mobile";
package/dist/styles.css CHANGED
@@ -5059,10 +5059,11 @@
5059
5059
  direction: rtl;
5060
5060
  }
5061
5061
  .rbc-off-range {
5062
- color: #999999;
5062
+ color: var(--foreground) !important;
5063
5063
  }
5064
5064
  .rbc-off-range-bg {
5065
- background: hsl(var(--muted));
5065
+ background: var(--foreground) !important;
5066
+ opacity: 0.1 !important;
5066
5067
  }
5067
5068
  .rbc-header {
5068
5069
  overflow: hidden;
@@ -5133,8 +5134,8 @@
5133
5134
  display: none;
5134
5135
  }
5135
5136
  .rbc-today {
5136
- background-color: hsl(var(--accent));
5137
- color: hsl(var(--accent-forground));
5137
+ background-color: oklch(100% 0.00011 271.152 / 0) !important;
5138
+ border: 3px solid var(--foreground) !important;
5138
5139
  }
5139
5140
  .rbc-toolbar {
5140
5141
  display: -webkit-box;
@@ -5311,7 +5312,8 @@
5311
5312
  background-color: rgba(0, 0, 0, 0.1);
5312
5313
  }
5313
5314
  .rbc-show-more {
5314
- background-color: rgba(255, 255, 255, 0.3);
5315
+ background-color: rgba(255, 255, 255, 0) !important;
5316
+ color: var(--foreground) !important;
5315
5317
  z-index: 4;
5316
5318
  font-weight: bold;
5317
5319
  font-size: 85%;
@@ -5805,819 +5807,6 @@
5805
5807
  border: none;
5806
5808
  border-radius: 50%;
5807
5809
  }
5808
- .rbc-btn-group {
5809
- font-size: 14px;
5810
- }
5811
- .custom-buttons {
5812
- font-size: 14px;
5813
- }
5814
- .rbc-date-cell.rbc-now,
5815
- .rbc-time-slot.rbc-now,
5816
- .rbc-show-more,
5817
- .rbc-header {
5818
- font-weight: normal !important;
5819
- }
5820
- .rbc-btn {
5821
- color: inherit;
5822
- font: inherit;
5823
- margin: 0;
5824
- }
5825
- button.rbc-btn {
5826
- overflow: visible;
5827
- text-transform: none;
5828
- -webkit-appearance: button;
5829
- -moz-appearance: button;
5830
- appearance: button;
5831
- cursor: pointer;
5832
- }
5833
- button[disabled].rbc-btn {
5834
- cursor: not-allowed;
5835
- }
5836
- button.rbc-input::-moz-focus-inner {
5837
- border: 0;
5838
- padding: 0;
5839
- }
5840
- .rbc-calendar {
5841
- -webkit-box-sizing: border-box;
5842
- box-sizing: border-box;
5843
- height: 100%;
5844
- display: -webkit-box;
5845
- display: -ms-flexbox;
5846
- display: flex;
5847
- font-size: 15px;
5848
- -webkit-box-orient: vertical;
5849
- -webkit-box-direction: normal;
5850
- -ms-flex-direction: column;
5851
- flex-direction: column;
5852
- -webkit-box-align: stretch;
5853
- -ms-flex-align: stretch;
5854
- align-items: stretch;
5855
- }
5856
- .rbc-m-b-negative-3 {
5857
- margin-bottom: -3px;
5858
- }
5859
- .rbc-h-full {
5860
- height: 100%;
5861
- }
5862
- .rbc-calendar *,
5863
- .rbc-calendar *:before,
5864
- .rbc-calendar *:after {
5865
- -webkit-box-sizing: inherit;
5866
- box-sizing: inherit;
5867
- }
5868
- .rbc-abs-full,
5869
- .rbc-row-bg {
5870
- overflow: hidden;
5871
- position: absolute;
5872
- top: 0;
5873
- left: 0;
5874
- right: 0;
5875
- bottom: 0;
5876
- }
5877
- .rbc-ellipsis,
5878
- .rbc-show-more,
5879
- .rbc-row-segment .rbc-event-content,
5880
- .rbc-event-label {
5881
- display: block;
5882
- overflow: hidden;
5883
- text-overflow: ellipsis;
5884
- white-space: nowrap;
5885
- }
5886
- .rbc-rtl {
5887
- direction: rtl;
5888
- }
5889
- .rbc-off-range {
5890
- color: #999999;
5891
- }
5892
- .rbc-off-range-bg {
5893
- background: hsl(var(--muted));
5894
- }
5895
- .rbc-header {
5896
- overflow: hidden;
5897
- -webkit-box-flex: 1;
5898
- -ms-flex: 1 0 0%;
5899
- flex: 1 0 0%;
5900
- text-overflow: ellipsis;
5901
- white-space: nowrap;
5902
- padding: 0 3px;
5903
- text-align: center;
5904
- vertical-align: middle;
5905
- font-weight: bold;
5906
- font-size: 90%;
5907
- min-height: 0;
5908
- border-bottom: 1px solid hsl(var(--border));
5909
- }
5910
- .rbc-header + .rbc-header {
5911
- border-left: 1px solid hsl(var(--border));
5912
- }
5913
- .rbc-rtl .rbc-header + .rbc-header {
5914
- border-left-width: 0;
5915
- border-right: 1px solid hsl(var(--border));
5916
- }
5917
- .rbc-header > a,
5918
- .rbc-header > a:active,
5919
- .rbc-header > a:visited {
5920
- color: inherit;
5921
- text-decoration: none;
5922
- }
5923
- .rbc-button-link {
5924
- color: inherit;
5925
- background: none;
5926
- margin: 0;
5927
- padding: 0;
5928
- border: none;
5929
- cursor: pointer;
5930
- -webkit-user-select: text;
5931
- -moz-user-select: text;
5932
- -ms-user-select: text;
5933
- user-select: text;
5934
- }
5935
- .rbc-row-content {
5936
- position: relative;
5937
- -moz-user-select: none;
5938
- -ms-user-select: none;
5939
- user-select: none;
5940
- -webkit-user-select: none;
5941
- z-index: 4;
5942
- }
5943
- .rbc-row-content-scrollable {
5944
- display: -webkit-box;
5945
- display: -ms-flexbox;
5946
- display: flex;
5947
- -webkit-box-orient: vertical;
5948
- -webkit-box-direction: normal;
5949
- -ms-flex-direction: column;
5950
- flex-direction: column;
5951
- height: 100%;
5952
- }
5953
- .rbc-row-content-scrollable .rbc-row-content-scroll-container {
5954
- height: 100%;
5955
- overflow-y: scroll;
5956
- -ms-overflow-style: none;
5957
- scrollbar-width: none;
5958
- }
5959
- .rbc-row-content-scrollable
5960
- .rbc-row-content-scroll-container::-webkit-scrollbar {
5961
- display: none;
5962
- }
5963
- .rbc-today {
5964
- background-color: hsl(var(--accent));
5965
- color: hsl(var(--accent-forground));
5966
- }
5967
- .rbc-toolbar {
5968
- display: -webkit-box;
5969
- display: -ms-flexbox;
5970
- display: flex;
5971
- -ms-flex-wrap: wrap;
5972
- flex-wrap: wrap;
5973
- -webkit-box-pack: center;
5974
- -ms-flex-pack: center;
5975
- justify-content: center;
5976
- -webkit-box-align: center;
5977
- -ms-flex-align: center;
5978
- align-items: center;
5979
- margin-bottom: 10px;
5980
- font-size: 16px;
5981
- }
5982
- .rbc-toolbar .rbc-toolbar-label {
5983
- -webkit-box-flex: 1;
5984
- -ms-flex-positive: 1;
5985
- flex-grow: 1;
5986
- padding: 0 10px;
5987
- text-align: center;
5988
- }
5989
- .rbc-toolbar button {
5990
- color: #373a3c;
5991
- display: inline-block;
5992
- margin: 0;
5993
- text-align: center;
5994
- vertical-align: middle;
5995
- background: none;
5996
- background-image: none;
5997
- border: 1px solid hsl(var(--border));
5998
- padding: 0.375rem 1rem;
5999
- border-radius: 4px;
6000
- line-height: normal;
6001
- white-space: nowrap;
6002
- }
6003
- .rbc-toolbar button:active,
6004
- .rbc-toolbar button.rbc-active {
6005
- background-image: none;
6006
- -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
6007
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
6008
- background-color: #e6e6e6;
6009
- border-color: #adadad;
6010
- }
6011
- .rbc-toolbar button:active:hover,
6012
- .rbc-toolbar button:active:focus,
6013
- .rbc-toolbar button.rbc-active:hover,
6014
- .rbc-toolbar button.rbc-active:focus {
6015
- color: #373a3c;
6016
- background-color: #d4d4d4;
6017
- border-color: #8c8c8c;
6018
- }
6019
- .rbc-toolbar button:focus {
6020
- color: #373a3c;
6021
- background-color: #e6e6e6;
6022
- border-color: #adadad;
6023
- }
6024
- .rbc-toolbar button:hover {
6025
- color: #373a3c;
6026
- background-color: #e6e6e6;
6027
- border-color: #adadad;
6028
- }
6029
- .rbc-btn-group {
6030
- display: inline-block;
6031
- white-space: nowrap;
6032
- }
6033
- .rbc-btn-group > button:first-child:not(:last-child) {
6034
- border-top-right-radius: 0;
6035
- border-bottom-right-radius: 0;
6036
- }
6037
- .rbc-btn-group > button:last-child:not(:first-child) {
6038
- border-top-left-radius: 0;
6039
- border-bottom-left-radius: 0;
6040
- }
6041
- .rbc-rtl .rbc-btn-group > button:first-child:not(:last-child) {
6042
- border-radius: 4px;
6043
- border-top-left-radius: 0;
6044
- border-bottom-left-radius: 0;
6045
- }
6046
- .rbc-rtl .rbc-btn-group > button:last-child:not(:first-child) {
6047
- border-radius: 4px;
6048
- border-top-right-radius: 0;
6049
- border-bottom-right-radius: 0;
6050
- }
6051
- .rbc-btn-group > button:not(:first-child):not(:last-child) {
6052
- border-radius: 0;
6053
- }
6054
- .rbc-btn-group button + button {
6055
- margin-left: -1px;
6056
- }
6057
- .rbc-rtl .rbc-btn-group button + button {
6058
- margin-left: 0;
6059
- margin-right: -1px;
6060
- }
6061
- .rbc-btn-group + .rbc-btn-group,
6062
- .rbc-btn-group + button {
6063
- margin-left: 10px;
6064
- }
6065
- @media (max-width: 767px) {
6066
- .rbc-toolbar {
6067
- -webkit-box-orient: vertical;
6068
- -webkit-box-direction: normal;
6069
- -ms-flex-direction: column;
6070
- flex-direction: column;
6071
- }
6072
- }
6073
- .rbc-event,
6074
- .rbc-day-slot .rbc-background-event {
6075
- border: none;
6076
- -webkit-box-sizing: border-box;
6077
- box-sizing: border-box;
6078
- -webkit-box-shadow: none;
6079
- box-shadow: none;
6080
- margin: 0;
6081
- padding: 2px 5px;
6082
- background-color: hsl(var(--input));
6083
- border-radius: 5px;
6084
- color: #fff;
6085
- cursor: pointer;
6086
- width: 100%;
6087
- text-align: left;
6088
- }
6089
- .rbc-slot-selecting .rbc-event,
6090
- .rbc-slot-selecting .rbc-day-slot .rbc-background-event,
6091
- .rbc-day-slot .rbc-slot-selecting .rbc-background-event {
6092
- cursor: inherit;
6093
- pointer-events: none;
6094
- }
6095
- .rbc-event.rbc-selected,
6096
- .rbc-day-slot .rbc-selected.rbc-background-event {
6097
- background-color: #265985;
6098
- }
6099
- .rbc-event:focus,
6100
- .rbc-day-slot .rbc-background-event:focus {
6101
- outline: 5px auto #3b99fc;
6102
- }
6103
- .rbc-event-label {
6104
- font-size: 80%;
6105
- }
6106
- .rbc-event-overlaps {
6107
- -webkit-box-shadow: -1px 1px 5px 0px rgba(51, 51, 51, 0.5);
6108
- box-shadow: -1px 1px 5px 0px rgba(51, 51, 51, 0.5);
6109
- }
6110
- .rbc-event-continues-prior {
6111
- border-top-left-radius: 0;
6112
- border-bottom-left-radius: 0;
6113
- }
6114
- .rbc-event-continues-after {
6115
- border-top-right-radius: 0;
6116
- border-bottom-right-radius: 0;
6117
- }
6118
- .rbc-event-continues-earlier {
6119
- border-top-left-radius: 0;
6120
- border-top-right-radius: 0;
6121
- }
6122
- .rbc-event-continues-later {
6123
- border-bottom-left-radius: 0;
6124
- border-bottom-right-radius: 0;
6125
- }
6126
- .rbc-row {
6127
- display: -webkit-box;
6128
- display: -ms-flexbox;
6129
- display: flex;
6130
- -webkit-box-orient: horizontal;
6131
- -webkit-box-direction: normal;
6132
- -ms-flex-direction: row;
6133
- flex-direction: row;
6134
- }
6135
- .rbc-row-segment {
6136
- padding: 0 1px 1px 1px;
6137
- }
6138
- .rbc-selected-cell {
6139
- background-color: rgba(0, 0, 0, 0.1);
6140
- }
6141
- .rbc-show-more {
6142
- background-color: rgba(255, 255, 255, 0.3);
6143
- z-index: 4;
6144
- font-weight: bold;
6145
- font-size: 85%;
6146
- height: auto;
6147
- line-height: normal;
6148
- color: hsl(var(--input));
6149
- }
6150
- .rbc-show-more:hover,
6151
- .rbc-show-more:focus {
6152
- color: #265985;
6153
- }
6154
- .rbc-month-view {
6155
- position: relative;
6156
- border: 1px solid hsl(var(--border));
6157
- display: -webkit-box;
6158
- display: -ms-flexbox;
6159
- display: flex;
6160
- -webkit-box-orient: vertical;
6161
- -webkit-box-direction: normal;
6162
- -ms-flex-direction: column;
6163
- flex-direction: column;
6164
- -webkit-box-flex: 1;
6165
- -ms-flex: 1 0 0px;
6166
- flex: 1 0 0;
6167
- width: 100%;
6168
- -moz-user-select: none;
6169
- -ms-user-select: none;
6170
- user-select: none;
6171
- -webkit-user-select: none;
6172
- height: 100%;
6173
- }
6174
- .rbc-month-header {
6175
- display: -webkit-box;
6176
- display: -ms-flexbox;
6177
- display: flex;
6178
- -webkit-box-orient: horizontal;
6179
- -webkit-box-direction: normal;
6180
- -ms-flex-direction: row;
6181
- flex-direction: row;
6182
- }
6183
- .rbc-month-row {
6184
- display: -webkit-box;
6185
- display: -ms-flexbox;
6186
- display: flex;
6187
- position: relative;
6188
- -webkit-box-orient: vertical;
6189
- -webkit-box-direction: normal;
6190
- -ms-flex-direction: column;
6191
- flex-direction: column;
6192
- -webkit-box-flex: 1;
6193
- -ms-flex: 1 0 0px;
6194
- flex: 1 0 0;
6195
- -ms-flex-preferred-size: 0px;
6196
- flex-basis: 0px;
6197
- overflow: hidden;
6198
- height: 100%;
6199
- }
6200
- .rbc-month-row + .rbc-month-row {
6201
- border-top: 1px solid hsl(var(--border));
6202
- }
6203
- .rbc-date-cell {
6204
- -webkit-box-flex: 1;
6205
- -ms-flex: 1 1 0px;
6206
- flex: 1 1 0;
6207
- min-width: 0;
6208
- padding-right: 5px;
6209
- text-align: right;
6210
- }
6211
- .rbc-date-cell.rbc-now {
6212
- font-weight: bold;
6213
- }
6214
- .rbc-date-cell > a,
6215
- .rbc-date-cell > a:active,
6216
- .rbc-date-cell > a:visited {
6217
- color: inherit;
6218
- text-decoration: none;
6219
- }
6220
- .rbc-row-bg {
6221
- display: -webkit-box;
6222
- display: -ms-flexbox;
6223
- display: flex;
6224
- -webkit-box-orient: horizontal;
6225
- -webkit-box-direction: normal;
6226
- -ms-flex-direction: row;
6227
- flex-direction: row;
6228
- -webkit-box-flex: 1;
6229
- -ms-flex: 1 0 0px;
6230
- flex: 1 0 0;
6231
- overflow: hidden;
6232
- right: 1px;
6233
- }
6234
- .rbc-day-bg {
6235
- -webkit-box-flex: 1;
6236
- -ms-flex: 1 0 0%;
6237
- flex: 1 0 0%;
6238
- }
6239
- .rbc-day-bg + .rbc-day-bg {
6240
- border-left: 1px solid hsl(var(--border));
6241
- }
6242
- .rbc-rtl .rbc-day-bg + .rbc-day-bg {
6243
- border-left-width: 0;
6244
- border-right: 1px solid hsl(var(--border));
6245
- }
6246
- .rbc-overlay {
6247
- position: absolute;
6248
- z-index: 5;
6249
- border: 1px solid #e5e5e5;
6250
- background-color: #fff;
6251
- -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
6252
- box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
6253
- padding: 10px;
6254
- }
6255
- .rbc-overlay > * + * {
6256
- margin-top: 1px;
6257
- }
6258
- .rbc-overlay-header {
6259
- border-bottom: 1px solid #e5e5e5;
6260
- margin: -10px -10px 5px -10px;
6261
- padding: 2px 10px;
6262
- }
6263
- .rbc-agenda-view {
6264
- display: -webkit-box;
6265
- display: -ms-flexbox;
6266
- display: flex;
6267
- -webkit-box-orient: vertical;
6268
- -webkit-box-direction: normal;
6269
- -ms-flex-direction: column;
6270
- flex-direction: column;
6271
- -webkit-box-flex: 1;
6272
- -ms-flex: 1 0 0px;
6273
- flex: 1 0 0;
6274
- overflow: auto;
6275
- }
6276
- .rbc-agenda-view table.rbc-agenda-table {
6277
- width: 100%;
6278
- border: 1px solid hsl(var(--border));
6279
- border-spacing: 0;
6280
- border-collapse: collapse;
6281
- }
6282
- .rbc-agenda-view table.rbc-agenda-table tbody > tr > td {
6283
- padding: 5px 10px;
6284
- vertical-align: top;
6285
- }
6286
- .rbc-agenda-view table.rbc-agenda-table .rbc-agenda-time-cell {
6287
- padding-left: 15px;
6288
- padding-right: 15px;
6289
- text-transform: lowercase;
6290
- }
6291
- .rbc-agenda-view table.rbc-agenda-table tbody > tr > td + td {
6292
- border-left: 1px solid hsl(var(--border));
6293
- }
6294
- .rbc-rtl .rbc-agenda-view table.rbc-agenda-table tbody > tr > td + td {
6295
- border-left-width: 0;
6296
- border-right: 1px solid hsl(var(--border));
6297
- }
6298
- .rbc-agenda-view table.rbc-agenda-table tbody > tr + tr {
6299
- border-top: 1px solid hsl(var(--border));
6300
- }
6301
- .rbc-agenda-view table.rbc-agenda-table thead > tr > th {
6302
- padding: 3px 5px;
6303
- text-align: left;
6304
- border-bottom: 1px solid hsl(var(--border));
6305
- }
6306
- .rbc-rtl .rbc-agenda-view table.rbc-agenda-table thead > tr > th {
6307
- text-align: right;
6308
- }
6309
- .rbc-agenda-time-cell {
6310
- text-transform: lowercase;
6311
- }
6312
- .rbc-agenda-time-cell .rbc-continues-after:after {
6313
- content: " »";
6314
- }
6315
- .rbc-agenda-time-cell .rbc-continues-prior:before {
6316
- content: "« ";
6317
- }
6318
- .rbc-agenda-date-cell,
6319
- .rbc-agenda-time-cell {
6320
- white-space: nowrap;
6321
- }
6322
- .rbc-agenda-event-cell {
6323
- width: 100%;
6324
- }
6325
- .rbc-time-column {
6326
- display: -webkit-box;
6327
- display: -ms-flexbox;
6328
- display: flex;
6329
- -webkit-box-orient: vertical;
6330
- -webkit-box-direction: normal;
6331
- -ms-flex-direction: column;
6332
- flex-direction: column;
6333
- min-height: 100%;
6334
- }
6335
- .rbc-time-column .rbc-timeslot-group {
6336
- -webkit-box-flex: 1;
6337
- -ms-flex: 1;
6338
- flex: 1;
6339
- }
6340
- .rbc-timeslot-group {
6341
- border-bottom: 1px solid hsl(var(--border));
6342
- min-height: 40px;
6343
- display: -webkit-box;
6344
- display: -ms-flexbox;
6345
- display: flex;
6346
- -webkit-box-orient: vertical;
6347
- -webkit-box-direction: normal;
6348
- -ms-flex-flow: column nowrap;
6349
- flex-flow: column nowrap;
6350
- }
6351
- .rbc-time-gutter,
6352
- .rbc-header-gutter {
6353
- -webkit-box-flex: 0;
6354
- -ms-flex: none;
6355
- flex: none;
6356
- }
6357
- .rbc-label {
6358
- padding: 0 5px;
6359
- }
6360
- .rbc-day-slot {
6361
- position: relative;
6362
- }
6363
- .rbc-day-slot .rbc-events-container {
6364
- bottom: 0;
6365
- left: 0;
6366
- position: absolute;
6367
- right: 0;
6368
- margin-right: 10px;
6369
- top: 0;
6370
- }
6371
- .rbc-day-slot .rbc-events-container.rbc-rtl {
6372
- left: 10px;
6373
- right: 0;
6374
- }
6375
- .rbc-day-slot .rbc-event,
6376
- .rbc-day-slot .rbc-background-event {
6377
- border: 1px solid #265985;
6378
- display: -webkit-box;
6379
- display: -ms-flexbox;
6380
- display: flex;
6381
- max-height: 100%;
6382
- min-height: 20px;
6383
- -webkit-box-orient: vertical;
6384
- -webkit-box-direction: normal;
6385
- -ms-flex-flow: column wrap;
6386
- flex-flow: column wrap;
6387
- -webkit-box-align: start;
6388
- -ms-flex-align: start;
6389
- align-items: flex-start;
6390
- overflow: hidden;
6391
- position: absolute;
6392
- }
6393
- .rbc-day-slot .rbc-background-event {
6394
- opacity: 0.75;
6395
- }
6396
- .rbc-day-slot .rbc-event-label {
6397
- -webkit-box-flex: 0;
6398
- -ms-flex: none;
6399
- flex: none;
6400
- padding-right: 5px;
6401
- width: auto;
6402
- }
6403
- .rbc-day-slot .rbc-event-content {
6404
- width: 100%;
6405
- -webkit-box-flex: 1;
6406
- -ms-flex: 1 1 0px;
6407
- flex: 1 1 0;
6408
- word-wrap: break-word;
6409
- line-height: 1;
6410
- height: 100%;
6411
- min-height: 1em;
6412
- }
6413
- .rbc-day-slot .rbc-time-slot {
6414
- border-top: 1px solid hsl(var(--border));
6415
- }
6416
- .rbc-time-view-resources .rbc-time-gutter,
6417
- .rbc-time-view-resources .rbc-time-header-gutter {
6418
- position: sticky;
6419
- left: 0;
6420
- background-color: white;
6421
- border-right: 1px solid hsl(var(--border));
6422
- z-index: 10;
6423
- margin-right: -1px;
6424
- }
6425
- .rbc-time-view-resources .rbc-time-header {
6426
- overflow: hidden;
6427
- }
6428
- .rbc-time-view-resources .rbc-time-header-content {
6429
- min-width: auto;
6430
- -webkit-box-flex: 1;
6431
- -ms-flex: 1 0 0px;
6432
- flex: 1 0 0;
6433
- -ms-flex-preferred-size: 0px;
6434
- flex-basis: 0px;
6435
- }
6436
- .rbc-time-view-resources .rbc-time-header-cell-single-day {
6437
- display: none;
6438
- }
6439
- .rbc-time-view-resources .rbc-day-slot {
6440
- min-width: 140px;
6441
- }
6442
- .rbc-time-view-resources .rbc-header,
6443
- .rbc-time-view-resources .rbc-day-bg {
6444
- width: 140px;
6445
- -webkit-box-flex: 1;
6446
- -ms-flex: 1 1 0px;
6447
- flex: 1 1 0;
6448
- -ms-flex-preferred-size: 0 px;
6449
- flex-basis: 0 px;
6450
- }
6451
- .rbc-time-header-content + .rbc-time-header-content {
6452
- margin-left: -1px;
6453
- }
6454
- .rbc-time-slot {
6455
- -webkit-box-flex: 1;
6456
- -ms-flex: 1 0 0px;
6457
- flex: 1 0 0;
6458
- }
6459
- .rbc-time-slot.rbc-now {
6460
- font-weight: bold;
6461
- }
6462
- .rbc-day-header {
6463
- text-align: center;
6464
- }
6465
- .rbc-slot-selection {
6466
- z-index: 10;
6467
- position: absolute;
6468
- background-color: rgba(0, 0, 0, 0.5);
6469
- color: white;
6470
- font-size: 75%;
6471
- width: 100%;
6472
- padding: 3px;
6473
- }
6474
- .rbc-slot-selecting {
6475
- cursor: move;
6476
- }
6477
- .rbc-time-view {
6478
- display: -webkit-box;
6479
- display: -ms-flexbox;
6480
- display: flex;
6481
- -webkit-box-orient: vertical;
6482
- -webkit-box-direction: normal;
6483
- -ms-flex-direction: column;
6484
- flex-direction: column;
6485
- -webkit-box-flex: 1;
6486
- -ms-flex: 1;
6487
- flex: 1;
6488
- width: 100%;
6489
- border: 1px solid hsl(var(--border));
6490
- min-height: 0;
6491
- }
6492
- .rbc-time-view .rbc-time-gutter {
6493
- white-space: nowrap;
6494
- text-align: right;
6495
- }
6496
- .rbc-time-view .rbc-allday-cell {
6497
- -webkit-box-sizing: content-box;
6498
- box-sizing: content-box;
6499
- width: 100%;
6500
- height: 100%;
6501
- position: relative;
6502
- }
6503
- .rbc-time-view .rbc-allday-cell + .rbc-allday-cell {
6504
- border-left: 1px solid hsl(var(--border));
6505
- }
6506
- .rbc-time-view .rbc-allday-events {
6507
- position: relative;
6508
- z-index: 4;
6509
- }
6510
- .rbc-time-view .rbc-row {
6511
- -webkit-box-sizing: border-box;
6512
- box-sizing: border-box;
6513
- min-height: 20px;
6514
- }
6515
- .rbc-time-header {
6516
- display: -webkit-box;
6517
- display: -ms-flexbox;
6518
- display: flex;
6519
- -webkit-box-flex: 0;
6520
- -ms-flex: 0 0 auto;
6521
- flex: 0 0 auto;
6522
- -webkit-box-orient: horizontal;
6523
- -webkit-box-direction: normal;
6524
- -ms-flex-direction: row;
6525
- flex-direction: row;
6526
- }
6527
- .rbc-time-header.rbc-overflowing {
6528
- border-right: 1px solid hsl(var(--border));
6529
- }
6530
- .rbc-rtl .rbc-time-header.rbc-overflowing {
6531
- border-right-width: 0;
6532
- border-left: 1px solid hsl(var(--border));
6533
- }
6534
- .rbc-time-header > .rbc-row:first-child {
6535
- border-bottom: 1px solid hsl(var(--border));
6536
- }
6537
- .rbc-time-header > .rbc-row.rbc-row-resource {
6538
- border-bottom: 1px solid hsl(var(--border));
6539
- }
6540
- .rbc-time-header-cell-single-day {
6541
- display: none;
6542
- }
6543
- .rbc-time-header-content {
6544
- -webkit-box-flex: 1;
6545
- -ms-flex: 1;
6546
- flex: 1;
6547
- display: -webkit-box;
6548
- display: -ms-flexbox;
6549
- display: flex;
6550
- min-width: 0;
6551
- -webkit-box-orient: vertical;
6552
- -webkit-box-direction: normal;
6553
- -ms-flex-direction: column;
6554
- flex-direction: column;
6555
- border-left: 1px solid hsl(var(--border));
6556
- }
6557
- .rbc-rtl .rbc-time-header-content {
6558
- border-left-width: 0;
6559
- border-right: 1px solid hsl(var(--border));
6560
- }
6561
- .rbc-time-header-content > .rbc-row.rbc-row-resource {
6562
- border-bottom: 1px solid hsl(var(--border));
6563
- -ms-flex-negative: 0;
6564
- flex-shrink: 0;
6565
- }
6566
- .rbc-time-content {
6567
- display: -webkit-box;
6568
- display: -ms-flexbox;
6569
- display: flex;
6570
- -webkit-box-flex: 1;
6571
- -ms-flex: 1 0 0%;
6572
- flex: 1 0 0%;
6573
- -webkit-box-align: start;
6574
- -ms-flex-align: start;
6575
- align-items: flex-start;
6576
- width: 100%;
6577
- border-top: 2px solid hsl(var(--border));
6578
- overflow-y: auto;
6579
- position: relative;
6580
- }
6581
- .rbc-time-content > .rbc-time-gutter {
6582
- -webkit-box-flex: 0;
6583
- -ms-flex: none;
6584
- flex: none;
6585
- }
6586
- .rbc-time-content > * + * > * {
6587
- border-left: 1px solid hsl(var(--border));
6588
- }
6589
- .rbc-rtl .rbc-time-content > * + * > * {
6590
- border-left-width: 0;
6591
- border-right: 1px solid hsl(var(--border));
6592
- }
6593
- .rbc-time-content > .rbc-day-slot {
6594
- width: 100%;
6595
- -moz-user-select: none;
6596
- -ms-user-select: none;
6597
- user-select: none;
6598
- -webkit-user-select: none;
6599
- }
6600
- .rbc-current-time-indicator {
6601
- position: absolute;
6602
- z-index: 3;
6603
- left: 0;
6604
- right: 0;
6605
- height: 1px;
6606
- background-color: #74ad31;
6607
- pointer-events: none;
6608
- }
6609
- .rbc-resource-grouping.rbc-time-header-content {
6610
- display: -webkit-box;
6611
- display: -ms-flexbox;
6612
- display: flex;
6613
- -webkit-box-orient: vertical;
6614
- -webkit-box-direction: normal;
6615
- -ms-flex-direction: column;
6616
- flex-direction: column;
6617
- }
6618
- .rbc-resource-grouping .rbc-row .rbc-header {
6619
- width: 141px;
6620
- }
6621
5810
  }
6622
5811
  @property --tw-translate-x {
6623
5812
  syntax: "*";
@@ -4,13 +4,13 @@ const cookiePrefix = "ikoncloud_next_";
4
4
  export async function setCookieSession(sessionName, data, options) {
5
5
  const cookieStore = await cookies();
6
6
  cookieStore.set(cookiePrefix + sessionName, data, {
7
- httpOnly: false,
7
+ httpOnly: true,
8
8
  sameSite: "lax",
9
9
  secure: process.env.NODE_ENV === "production",
10
10
  path: "/",
11
11
  domain: process.env.NEXT_PUBLIC_COOKIE_DOMAIN,
12
12
  expires: options === null || options === void 0 ? void 0 : options.expires,
13
- maxAge: options === null || options === void 0 ? void 0 : options.maxAge
13
+ maxAge: options === null || options === void 0 ? void 0 : options.maxAge,
14
14
  });
15
15
  }
16
16
  export async function getCookieSession(sessionName) {
@@ -1,7 +1,9 @@
1
- export interface AccessTokenOptionsProps {
1
+ interface AccessTokenOptionsProps {
2
2
  isNotLogOutWhenExpire?: boolean;
3
3
  isSetToken?: boolean;
4
4
  }
5
5
  export declare function getValidAccessToken(options?: AccessTokenOptionsProps): Promise<string | null>;
6
6
  export declare function refreshAccessToken(refreshToken: string, isSetToken?: boolean): Promise<string | null>;
7
+ export declare function decodeAccessToken(): Promise<import("jwt-decode").JwtPayload | null>;
7
8
  export declare function logOut(): Promise<void>;
9
+ export {};
@@ -1,82 +1,69 @@
1
1
  "use server";
2
2
  import { redirect } from "next/navigation";
3
3
  import { clearAllCookieSession, getCookieSession, setCookieSession, } from "../session/cookieSession";
4
+ import { jwtDecode } from "jwt-decode";
5
+ // Prevent multiple refresh calls at once
6
+ let refreshPromise = null;
4
7
  export async function getValidAccessToken(options) {
5
8
  const accessToken = await getCookieSession("accessToken");
9
+ console.log("Access Token....:");
6
10
  const refreshToken = await getCookieSession("refreshToken");
7
- if (accessToken) {
11
+ console.log("Refresh Token...");
12
+ console.log("Before Return Access Token:...............................................");
13
+ if (accessToken)
8
14
  return accessToken;
9
- }
15
+ console.log("After Return Access Token:...............................................");
10
16
  if (refreshToken) {
11
- // Refresh token is valid, call the refresh token API
12
- const newAccessToken = await refreshAccessToken(refreshToken, options === null || options === void 0 ? void 0 : options.isSetToken);
13
- if (newAccessToken) {
14
- return newAccessToken; // Return the new access token
17
+ console.log("Refreshing access token using refresh token...", refreshToken);
18
+ if (!refreshPromise) {
19
+ refreshPromise = refreshAccessToken(refreshToken, true);
20
+ refreshPromise.finally(() => (refreshPromise = null));
15
21
  }
22
+ return await refreshPromise;
16
23
  }
17
24
  if (!(options === null || options === void 0 ? void 0 : options.isNotLogOutWhenExpire)) {
18
25
  await logOut();
19
26
  }
20
- // If both tokens are invalid, return null
21
27
  return null;
22
28
  }
23
29
  export async function refreshAccessToken(refreshToken, isSetToken) {
24
30
  try {
25
- // Replace this with your actual API call to refresh the token
26
- const response = await fetch(`${process.env.IKON_API_URL}/platform/auth/refresh-token`, {
31
+ console.log("Refreshing access token...");
32
+ const response = await fetch(`https://ikoncloud-dev.keross.com/ikon-api/platform/auth/refresh-token`, {
27
33
  method: "POST",
28
- headers: {
29
- "Content-Type": "application/json",
30
- },
34
+ credentials: "include",
35
+ headers: { "Content-Type": "application/json" },
31
36
  body: JSON.stringify({ refreshToken }),
32
37
  });
33
- if (response.ok) {
34
- const data = await response.json();
35
- const { accessToken, refreshToken, expiresIn, refreshExpiresIn, } = data;
36
- if (isSetToken) {
37
- try {
38
- await setCookieSession("accessToken", accessToken, {
39
- maxAge: expiresIn,
40
- });
41
- await setCookieSession("refreshToken", refreshToken, {
42
- maxAge: refreshExpiresIn,
43
- });
44
- }
45
- catch (error) {
46
- console.error(error);
47
- }
48
- }
49
- // const headerList = headers();
50
- // const protocol = (await headerList).get("x-forwarded-proto") || "http";
51
- // const hostname = (await headerList).get("host") || "localhost:3000";
52
- // const host = `${protocol}://${hostname}`;
53
- // // Save the new access token and its expiration time
54
- // try {
55
- // const res = await fetch(`${host}/api/auth/set-token`, {
56
- // method: "POST",
57
- // headers: {
58
- // "Content-Type": "application/json",
59
- // },
60
- // body: JSON.stringify(tokenData),
61
- // credentials: "include", // Include credentials to send cookies
62
- // });
63
- // if (res.ok) {
64
- // console.log("Token updated successfully");
65
- // } else {
66
- // console.error("Failed to update token");
67
- // }
68
- // } catch (error) {
69
- // console.error("Error updating token:", error);
70
- // }
71
- return accessToken;
38
+ console.log("Refresh Token API Response:", response.status);
39
+ if (!response.ok)
40
+ return null;
41
+ const { accessToken, refreshToken: newRefreshToken, expiresIn, refreshExpiresIn, } = await response.json();
42
+ // Always set new access token
43
+ await setCookieSession("accessToken", accessToken, {
44
+ maxAge: expiresIn,
45
+ });
46
+ // IMPORTANT: Save the rotated refresh token
47
+ if (newRefreshToken) {
48
+ await setCookieSession("refreshToken", newRefreshToken, {
49
+ maxAge: refreshExpiresIn,
50
+ });
51
+ console.log("Refresh token rotated & updated.");
72
52
  }
53
+ console.log(" Access token refreshed successfully.");
54
+ return accessToken;
73
55
  }
74
56
  catch (error) {
75
57
  console.error("Failed to refresh access token:", error);
58
+ return null;
76
59
  }
77
- return null;
60
+ }
61
+ export async function decodeAccessToken() {
62
+ const accessToken = await getValidAccessToken();
63
+ return accessToken ? jwtDecode(accessToken) : null;
78
64
  }
79
65
  export async function logOut() {
80
66
  await clearAllCookieSession();
67
+ console.log("Logging out...");
81
68
  redirect("/login.html");
82
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ikoncomponents",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "css": "dist/styles.css",